Skip to content

Commit 2f27a43

Browse files
authored
Merge pull request #247 from oslokommune/fix-env-and-binary-downloads
Fix binary downloads and `--env` for uploads
2 parents f8efe3f + fc99e52 commit 2f27a43

4 files changed

Lines changed: 20 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
* New commands `datasets delete-version`, `datasets delete-edition`, and
77
`datasets delete-distribution` for deleting dataset versions, editions, and
88
distributions respectively.
9+
* Fixed binary file downloads.
910
* Streamlined output in the dataset listing commands.
1011
* New option `--verbose` for the `datasets ls` command which lists every
1112
relevant metadata field for the listed datasets.
1213
* New output format option for printing CSV: `--format=csv`.
1314
* Better error messages for status traces that never finish in `status --watch`.
14-
* Improved SIGPIPE handling so that `okdata` works better with tools
15-
such as `head`.
15+
* Improved SIGPIPE handling so that `okdata` works better with tools such
16+
as `head`.
17+
* Fixed handling of the `--env` parameter when uploading datasets (it would
18+
previously be ignored).
1619

1720
## 4.4.0 - 2025-05-14
1821

okdata/cli/commands/datasets/datasets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class DatasetsCommand(BaseCommand):
5252

5353
def __init__(self):
5454
super().__init__(Dataset)
55-
self.download = Download(env=self.opt("env"))
5655

5756
def handler(self):
5857
self.log.info("DatasetsCommand.handle()")
@@ -389,7 +388,7 @@ def _dataset_components_from_uri(
389388
return dataset_id, version, edition
390389

391390
def upload_file(self, source, target):
392-
upload = Upload()
391+
upload = Upload(env=self.opt("env"))
393392
dataset_id, version, edition = self._dataset_components_from_uri(target, True)
394393

395394
self.log.info(f"Will upload file to: {dataset_id}/{version}/{edition})")
@@ -420,8 +419,9 @@ def upload_file(self, source, target):
420419
self.print("\n".join(summary))
421420

422421
def download_files(self, source, target):
422+
download = Download(env=self.opt("env"))
423423
dataset_id, version, edition = self._dataset_components_from_uri(source)
424-
downloaded_files = self.download.download(
424+
downloaded_files = download.download(
425425
dataset_id, version, edition, resolve_output_filepath(target)
426426
)
427427
self.log.info(f"Download returned: {downloaded_files}")

requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ attrs==25.3.0
88
# via
99
# jsonschema
1010
# referencing
11-
certifi==2025.6.15
11+
certifi==2025.8.3
1212
# via requests
1313
cffi==1.17.1
1414
# via cryptography
15-
charset-normalizer==3.4.2
15+
charset-normalizer==3.4.3
1616
# via requests
17-
cryptography==45.0.4
17+
cryptography==45.0.7
1818
# via jwcrypto
1919
deprecation==2.1.0
2020
# via python-keycloak
2121
docopt==0.6.2
2222
# via okdata-cli (setup.py)
2323
idna==3.10
2424
# via requests
25-
jsonschema==4.24.0
25+
jsonschema==4.25.1
2626
# via okdata-sdk
27-
jsonschema-specifications==2025.4.1
27+
jsonschema-specifications==2025.9.1
2828
# via jsonschema
2929
jwcrypto==1.5.6
3030
# via python-keycloak
31-
okdata-sdk==3.3.0
31+
okdata-sdk==3.4.0
3232
# via okdata-cli (setup.py)
3333
packaging==25.0
3434
# via deprecation
3535
prettytable==3.16.0
3636
# via okdata-cli (setup.py)
37-
prompt-toolkit==3.0.51
37+
prompt-toolkit==3.0.52
3838
# via questionary
3939
pycparser==2.22
4040
# via cffi
@@ -46,19 +46,19 @@ referencing==0.36.2
4646
# via
4747
# jsonschema
4848
# jsonschema-specifications
49-
requests==2.32.4
49+
requests==2.32.5
5050
# via
5151
# okdata-cli (setup.py)
5252
# okdata-sdk
5353
# python-keycloak
5454
# requests-toolbelt
5555
requests-toolbelt==1.0.0
5656
# via python-keycloak
57-
rpds-py==0.25.1
57+
rpds-py==0.27.1
5858
# via
5959
# jsonschema
6060
# referencing
61-
typing-extensions==4.14.0
61+
typing-extensions==4.15.0
6262
# via jwcrypto
6363
urllib3==2.5.0
6464
# via

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
],
2424
},
2525
install_requires=[
26-
"PrettyTable",
2726
"docopt",
28-
"okdata-sdk>=3.3,<4",
27+
"okdata-sdk>=3.4,<4",
28+
"PrettyTable",
2929
"questionary>=1.10.0,<2.0.0",
3030
"requests",
3131
],

0 commit comments

Comments
 (0)