Skip to content

Commit 228ff1c

Browse files
Copilotjoocer
andcommitted
Fix prefix removal to handle both protocols and custom prefixes correctly
Co-authored-by: joocer <[email protected]>
1 parent 92052a0 commit 228ff1c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opteryx/connectors/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ def connector_factory(dataset, statistics, **config):
285285
prefix = connector_entry.pop("prefix", "")
286286
remove_prefix = connector_entry.pop("remove_prefix", False)
287287
if prefix and remove_prefix and dataset.startswith(prefix):
288+
# Remove the prefix. If there's a separator (. or //) after the prefix, skip it too
288289
dataset = dataset[len(prefix):]
290+
if dataset.startswith(".") or dataset.startswith("//"):
291+
dataset = dataset[1:] if dataset.startswith(".") else dataset[2:]
289292

290293
return connector(dataset=dataset, statistics=statistics, **connector_entry)
291294

0 commit comments

Comments
 (0)