Skip to content

Commit

Permalink
Use os.path for Windows compatibility (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjoel authored and erlendvollset committed Mar 25, 2019
1 parent 90f48d7 commit 00b57ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Changes are grouped as follows
### Changed
- Rename methods so they reflect what the method does instead of what http method is used

## [0.13.3] - 2019-03-25
### Fixed
- Make `upload_artifacts_from_directory` work on Windows

## [0.13.1] - 2019-03-14
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cognite.client.cognite_client import CogniteClient
from cognite.client.exceptions import APIError

__version__ = "0.13.2"
__version__ = "0.13.3"
3 changes: 1 addition & 2 deletions cognite/client/experimental/model_hosting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,10 @@ def upload_artifacts_from_directory(self, model_id: int, version_id: int, direct
None
"""
upload_tasks = []
root_directory_name = directory.split("/")[-1]
for root, dirs, files in os.walk(directory):
for file_name in files:
file_path = os.path.join(root, file_name)
full_file_name = file_path.split("{}/".format(root_directory_name))[-1]
full_file_name = os.path.relpath(file_path, directory)
upload_tasks.append((model_id, version_id, full_file_name, file_path))
self._execute_tasks_concurrently(self.upload_artifact_from_file, upload_tasks)

Expand Down

0 comments on commit 00b57ce

Please sign in to comment.