Skip to content

Commit

Permalink
Add Example local dlt execution with dbt
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek committed Dec 7, 2024
1 parent 1025768 commit c9d1f57
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions opendbt/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def submit_local_python_job(self, parsed_model: Dict, compiled_code: str):
# Load the module
sys.modules[model_name] = module
spec.loader.exec_module(module)
# Access and call `model` function of the model! NOTE: session argument is None here.
dbt = module.dbtObj(None)
# Access and call `model` function of the model!
# IMPORTANT: here we are passing down duckdb session from the adapter to the model
module.model(dbt=dbt, session=connection.handle)
model_file.close()
Expand Down Expand Up @@ -63,7 +63,6 @@ def submit_local_dlt_job(self, parsed_model: Dict, compiled_code: str):
# Load the module
sys.modules[model_name] = module
spec.loader.exec_module(module)
# Access and call `model` function of the model! NOTE: session argument is None here.
dbt = module.dbtObj(None)
# IMPORTANT: here we are passing down duckdb session from the adapter to the model
module.model(dbt=dbt, pipeline=_pipeline)
Expand Down

0 comments on commit c9d1f57

Please sign in to comment.