Open was-av opened 20 hours ago
Hey @was-av! 👋 I'm here to help you with bug fixes, answer your questions, and guide you on becoming a contributor.
The error you're encountering is due to the --output-keys
argument in the dbt ls
command being passed as separate strings instead of a single string. This causes dbt to misinterpret the arguments.
To fix this, you need to modify the run_dbt_ls
function in cosmos/dbt/graph.py
to concatenate the --output-keys
values into a single string. Here is the corrected code snippet:
def run_dbt_ls(
self, dbt_cmd: str, project_path: Path, tmp_dir: Path, env_vars: dict[str, str]
) -> dict[str, DbtNode]:
"""Runs dbt ls command and returns the parsed nodes."""
if self.render_config.source_rendering_behavior != SourceRenderingBehavior.NONE:
ls_command = [
dbt_cmd,
"ls",
"--output",
"json",
"--output-keys",
"name unique_id resource_type depends_on original_file_path tags config freshness",
]
else:
ls_command = [dbt_cmd, "ls", "--output", "json"]
This change ensures that the --output-keys
argument is correctly formatted as a single string, which should resolve the error you're seeing [1].
To continue talking to Dosu, mention @dosu.
Hey @was-av, The source node rendering feature is available only for dbt-core >= 1.5
https://astronomer.github.io/astronomer-cosmos/configuration/source-nodes-rendering.html
@pankajastro thanks for your quick answer. Could you explain why the source node rendering feature required dbt-core min version 1.5?
Astronomer Cosmos Version
Other Astronomer Cosmos version (please specify below)
If "Other Astronomer Cosmos version" selected, which one?
1.6.0
dbt-core version
1.3.2
Versions of dbt adapters
dbt-clickhouse==1.3.3 dbt-core==1.3.2 dbt-extractor==0.4.1
LoadMode
AUTOMATIC
ExecutionMode
LOCAL
InvocationMode
DBT_RUNNER
airflow version
2.10.1
Operating System
"Debian GNU/Linux 11 (bullseye)
If a you think it's an UI issue, what browsers are you seeing the problem on?
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
No response
What happened?
I add sources to Airflow DAG by selecting source_rendering_behavior equal to SourceRenderingBehavior.ALL and get Error described below.
Relevant log output
How to reproduce
Anything else :)?
Error related to code in file cosmos/dbt/graph.py
Options value of --output-keys must added as one string.
Are you willing to submit PR?
Contact Details
wasrull@gmal.com