Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent loading source data via plugin during dbt parsing phase #178

Merged
merged 1 commit into from
Jun 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dbt/adapters/duckdb/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def create_from_source(cls: Type[Self], source: SourceDefinition, **kwargs: Any)
# reference in the compiled model
if "plugin" in source_config:
plugin_name = source_config["plugin"]
DuckDBConnectionManager.env().load_source(plugin_name, source_config)
if DuckDBConnectionManager._ENV is not None:
# No connection means we are probably in the dbt parsing phase, so don't load yet.
DuckDBConnectionManager.env().load_source(plugin_name, source_config)
elif "external_location" in source_config.meta:
# Call str.format with the schema, name and identifier for the source so that they
# can be injected into the string; this helps reduce boilerplate when all
Expand Down