Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use cached relpath in parallel code #2738

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deeplake/core/storage/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _all_keys(self, prefix: str = ""):
self._check_update_creds()
prefix = posixpath.join(self.root_folder, prefix)
return {
relpath(blob.name, self.root_folder)
posixpath.relpath(blob.name, self.root_folder)
for blob in self.container_client.list_blobs(
name_starts_with=prefix, include=["metadata"]
)
Expand Down
2 changes: 1 addition & 1 deletion deeplake/core/storage/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def _get_path_from_key(self, key):

def _all_keys(self):
self._blob_objects = self.client_bucket.list_blobs(prefix=self.path)
return {relpath(obj.name, self.path) for obj in self._blob_objects}
return {posixpath.relpath(obj.name, self.path) for obj in self._blob_objects}

def _set_hub_creds_info(
self,
Expand Down
2 changes: 1 addition & 1 deletion deeplake/core/storage/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _all_keys(self, refresh: bool = False) -> Set[str]:
for root, dirs, files in os.walk(full_path):
for file in files:
key_set.add(
relpath(
posixpath.relpath(
posixpath.join(pathlib.Path(root).as_posix(), file),
pathlib.Path(full_path).as_posix(),
)
Expand Down
2 changes: 1 addition & 1 deletion deeplake/util/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def store_data_slice_with_pbar(pg_callback, transform_input: Tuple) -> Dict:
if isinstance(data_slice, deeplake.Dataset):
data_slice = add_cache_to_dataset_slice(data_slice, tensors)

rel_tensors = [relpath(tensor, group_index) for tensor in visible_tensors]
rel_tensors = [posixpath.relpath(tensor, group_index) for tensor in visible_tensors]

transform_dataset = TransformDataset(
rel_tensors,
Expand Down
Loading