Skip to content

Commit 5e993f1

Browse files
Copilotjoocer
andcommitted
Fix dot-to-slash conversion to only apply to dataset references, not file paths
Co-authored-by: joocer <[email protected]>
1 parent 228ff1c commit 5e993f1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

opteryx/connectors/aws_s3_connector.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ def __init__(self, credentials=None, **kwargs):
8686
)
8787

8888
self.minio = Minio(end_point, access_key, secret_key, secure=secure)
89-
self.dataset = self.dataset.replace(".", OS_SEP)
89+
90+
# Only convert dots to path separators if the dataset doesn't already contain slashes
91+
# Dataset references like "my.dataset.table" use dots as separators
92+
# File paths like "bucket/path/file.parquet" already have slashes and should not be converted
93+
if OS_SEP not in self.dataset and "/" not in self.dataset:
94+
self.dataset = self.dataset.replace(".", OS_SEP)
9095

9196
# Check if dataset contains wildcards
9297
self.has_wildcards = paths.has_wildcards(self.dataset)

opteryx/connectors/gcp_cloudstorage_connector.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ def __init__(self, credentials=None, **kwargs):
9191
Asynchronous.__init__(self, **kwargs)
9292
Statistics.__init__(self, **kwargs)
9393

94-
self.dataset = self.dataset.replace(".", OS_SEP)
94+
# Only convert dots to path separators if the dataset doesn't already contain slashes
95+
# Dataset references like "my.dataset.table" use dots as separators
96+
# File paths like "bucket/path/file.parquet" already have slashes and should not be converted
97+
if OS_SEP not in self.dataset and "/" not in self.dataset:
98+
self.dataset = self.dataset.replace(".", OS_SEP)
9599
self.credentials = credentials
96100

97101
# Check if dataset contains wildcards

0 commit comments

Comments
 (0)