Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 53f804a

Browse files
authored
Support connections to DuckDB for data-diff --dbt (#1)
1 parent 2fe17a1 commit 53f804a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sqeleton/databases/duckdb.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,14 @@ def create_connection(self):
166166
return ddb.connect(self._args["filepath"])
167167
except ddb.OperationalError as e:
168168
raise ConnectError(*e.args) from e
169+
170+
def _normalize_table_path(self, path: DbPath) -> DbPath:
171+
if len(path) == 1:
172+
return self.default_schema, path[0]
173+
elif len(path) == 2:
174+
return path
175+
elif len(path) > 2:
176+
# Use only the last two values from the path
177+
return path[-2:]
178+
179+
raise ValueError(f"{self.name}: Bad table path for {self}: '{'.'.join(path)}'. Expected form: schema.table")

0 commit comments

Comments
 (0)