Skip to content

Commit

Permalink
add check back to _register_data_lake to see if S3 or GCS are present…
Browse files Browse the repository at this point in the history
… before trying to register the file system with the cloud
  • Loading branch information
Ryan Waldorf committed Jan 31, 2025
1 parent 95f6528 commit ee67bae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions universql/warehouse/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ def register_locations(self, tables: Locations):
raise Exception("Unsupported operation")

def _register_data_lake(self, args: dict):
self.duckdb.register_filesystem(s3(args))
self.duckdb.register_filesystem(gcs(args))
if args.get('aws_profile') is not None or self.account.cloud == 'aws':
self.duckdb.register_filesystem(s3(args))
if args.get('gcp_project') is not None or self.account.cloud == 'gcp':
self.duckdb.register_filesystem(gcs(args))

def get_table_paths(self, tables: List[sqlglot.exp.Table]) -> Tables:
native_tables = {}
Expand Down Expand Up @@ -374,6 +376,7 @@ def execute(self, ast: sqlglot.exp.Expression, catalog_executor: Executor, locat

def get_as_table(self) -> pyarrow.Table:
arrow_table = self.catalog.emulator._arrow_table

if arrow_table is None:
raise QueryError("No result returned from DuckDB")
for idx, column in enumerate(self.catalog.duckdb.description):
Expand Down

0 comments on commit ee67bae

Please sign in to comment.