Skip to content

Commit

Permalink
fix(duckdb): only try to load extensions when necessary for csv
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and ibis-squawk-bot[bot] committed Jan 14, 2023
1 parent 307d6dc commit c77bde7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def read_csv(
sql = f"""CREATE OR REPLACE VIEW {quoted_table_name} AS
SELECT * FROM read_csv({', '.join(args)})"""

self._load_extensions(["httpfs"])
if any(source.startswith(("http://", "https://")) for source in source_list):
self._load_extensions(["httpfs"])

with self.begin() as bind:
bind.execute(sql)
return self._read(table_name)
Expand Down

0 comments on commit c77bde7

Please sign in to comment.