https://prefect.io logo
Title
d

Dennis Hinnenkamp

09/12/2022, 12:10 PM
Hi all, I am trying to read the configuration from a
snowflake_connector_block
for a dbt shell task, but I get the following error when I use the created `dbt_cli_profile`:
14:07:11.533 | ERROR   | Task run 'trigger_dbt_cli_command-321ca940-0' - Encountered exception during execution:
Traceback (most recent call last):
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect/engine.py", line 1185, in orchestrate_task_run
    result = await task.fn(*args, **kwargs)
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect_dbt/cli/commands.py", line 136, in trigger_dbt_cli_command
    profile = dbt_cli_profile.get_profile()
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect_dbt/cli/credentials.py", line 107, in get_profile
    "outputs": {self.target: self.target_configs.get_configs()},
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect_dbt/cli/configs/snowflake.py", line 78, in get_configs
    configs_json = super().get_configs()
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect_dbt/cli/configs/base.py", line 53, in get_configs
    return self._populate_configs_json({}, self.dict())
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect_dbt/cli/configs/base.py", line 34, in _populate_configs_json
    configs_json = self._populate_configs_json(configs_json, value)
  File "/Users/d.hinnenkamp/Desktop/test-prefect/.venv/lib/python3.8/site-packages/prefect_dbt/cli/configs/base.py", line 37, in _populate_configs_json
    raise ValueError(
ValueError: The keyword, _is_anonymous, has already been provided in TargetConfigs; remove duplicated keywords to continue
My current code looks like this:
snowflake_connector_block = await SnowflakeConnector.load("wld-snowflake-connection")
connector = snowflake_connector_block
target_configs = SnowflakeTargetConfigs(
connector=connector
)
dbt_cli_profile = DbtCliProfile(
name="profile_name",
target="dev",
target_configs=target_configs
)
debug = await trigger_dbt_cli_command.submit(
"dbt debug",
profiles_dir='profile',
project_dir='wld-dbt-warehouse/dbt-project',
overwrite_profiles=True,
dbt_cli_profile=dbt_cli_profile,
return_state=True
)
1
a

alex

09/12/2022, 2:11 PM
Thanks for reporting this @Dennis Hinnenkamp! This looks like it’s a bug so I’ve created an issue in GitHub to track this.
👀 1
d

Dennis Hinnenkamp

09/12/2022, 3:09 PM
Thank you @alex