Skip to content

Commit

Permalink
use windows-style separator if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Mar 18, 2024
1 parent 88af72c commit 90d78f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion airbyte/caches/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing import Union

from overrides import overrides
from typing_extensions import Literal

from airbyte._processors.sql.duckdb import DuckDBSqlProcessor
from airbyte.caches.base import CacheBase
Expand Down Expand Up @@ -60,5 +61,8 @@ def get_database_name(self) -> str:
if self.db_path == ":memory:":
return "memory"

# Split the path on the appropriate separator ("/" or "\")
split_on: Literal["/", "\\"] = "\\" if "\\" in str(self.db_path) else "/"

# Return the file name without the extension
return str(self.db_path).split("/")[-1].split(".")[0]
return str(self.db_path).split(sep=split_on)[-1].split(".")[0]

0 comments on commit 90d78f7

Please sign in to comment.