Slackbot
03/22/2024, 10:50 AMMarvin
03/22/2024, 10:50 AMI'm using```Flow could not be retrieved from deployment. Traceback (most recent call last): File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/opt/prefect/prefect-kbn/pipelines/tt_marketing/tt_organic_main_flow.py", line 4, in from prefect_dbt.cli import DbtCoreOperation File "/usr/local/lib/python3.10/site-packages/prefect_dbt/__init__.py", line 4, in from .cli import ( # noqa File "/usr/local/lib/python3.10/site-packages/prefect_dbt/cli/__init__.py", line 1, in from .credentials import DbtCliProfile # noqa File "/usr/local/lib/python3.10/site-packages/prefect_dbt/cli/credentials.py", line 12, in from prefect_dbt.cli.configs import GlobalConfigs, TargetConfigs File "/usr/local/lib/python3.10/site-packages/prefect_dbt/cli/configs/__init__.py", line 9, in from .bigquery import BigQueryTargetConfigs # noqa File "/usr/local/lib/python3.10/site-packages/prefect_dbt/cli/configs/bigquery.py", lineHow to fix this :prefect-dbt==0.4.1
Marvin
03/22/2024, 10:54 AMAttributeError: module 'openssl' has no attribute 'keys'
error. However, from the Prefect documentation, there is an example of how to correctly import and use `DbtCoreOperation`:
python
from prefect_dbt.cli import DbtCoreOperation
@flow
def trigger_dbt_flow():
dbt_cli_profile = DbtCliProfile.load("DBT-CORE-OPERATION-BLOCK-NAME-PLACEHOLDER")
with DbtCoreOperation(
commands=["dbt debug", "dbt run"],
project_dir="PROJECT-DIRECTORY-PLACEHOLDER",
profiles_dir="PROFILES-DIRECTORY-PLACEHOLDER",
dbt_cli_profile=dbt_cli_profile,
) as dbt_operation:
dbt_process = dbt_operation.trigger()
dbt_process.wait_for_completion()
result = dbt_process.fetch_result()
return result
Prefect + Dbt Integration
Regarding the AttributeError
, it appears that this is a more generic python error not directly related to Prefect or listed as an open issue on Prefect's GitHub. It's possible that there is an issue with the installed version of openssl
or cryptography
library in your environment that is not compatible with the code. I would recommend checking your environment and ensuring all dependencies are correctly installed and are compatible with each other. If you continue to face this issue, consider reaching out to the maintainers of the involved packages.