Skip to content

dbt: Fix --target-path CLI flag being ignored (#4141)#4298

Merged
kacpermuda merged 1 commit into
OpenLineage:mainfrom
gaurav-atlan:fix/target-path-flag
Jan 30, 2026
Merged

dbt: Fix --target-path CLI flag being ignored (#4141)#4298
kacpermuda merged 1 commit into
OpenLineage:mainfrom
gaurav-atlan:fix/target-path-flag

Conversation

@gaurav-atlan
Copy link
Copy Markdown
Contributor

The --target-path CLI flag was not being parsed from command line arguments and passed to the DbtStructuredLogsProcessor and DbtLocalArtifactProcessor constructors. This caused the processors to always use the default target path instead of the user-specified one.

One-line summary for changelog:

Fix --target-path CLI flag being ignored in dbt-ol command (#4141)

Meaningful description

Problem: When running dbt-ol run --target-path /custom/path, the --target-path CLI flag was being ignored. The tool would always look for artifacts (run_results.json, manifest.json, etc.) in the default target/ directory instead of the user-specified path.

Root cause: The main() function in integration/dbt/src/openlineage/dbt/__init__.py was not parsing the --target-path argument from the command line. Although DbtLocalArtifactProcessor already accepts a target_path parameter and has proper precedence logic in build_target_path(), the value was never being extracted from CLI arguments and passed to the processor constructors.

Solution: Parse --target-path from CLI arguments in main() and pass it through to both consume_structured_logs() and consume_local_artifacts() functions, which then forward it to their respective processor constructors (DbtStructuredLogsProcessor and DbtLocalArtifactProcessor).

Alternatives considered: None - this was a straightforward bug fix where the existing infrastructure to handle target_path was already in place but simply not being utilized.

The --target-path CLI flag was not being parsed from command line
arguments and passed to the DbtStructuredLogsProcessor and
DbtLocalArtifactProcessor constructors. This caused the processors
to always use the default target path instead of the user-specified one.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Gaurav Sahu <Gaurav.sahu@atlan.com>
@gaurav-atlan gaurav-atlan requested a review from a team as a code owner January 29, 2026 18:57
@boring-cyborg boring-cyborg Bot added area:integration/dbt openlineage-dbt area:tests Testing code language:python Uses Python programming language labels Jan 29, 2026
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Jan 29, 2026

Thanks for opening your first OpenLineage pull request! We appreciate your contribution. If you haven't already, please make sure you've reviewed our guide for new contributors (https://github.com/OpenLineage/OpenLineage/blob/main/CONTRIBUTING.md).

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.68%. Comparing base (ea3bc55) to head (fba2ceb).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4298   +/-   ##
=======================================
  Coverage   71.68%   71.68%           
=======================================
  Files          21       21           
  Lines        2179     2179           
=======================================
  Hits         1562     1562           
  Misses        617      617           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kacpermuda kacpermuda merged commit 942a0a0 into OpenLineage:main Jan 30, 2026
27 checks passed
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Jan 30, 2026

Great job! Congrats on your first merged pull request in OpenLineage!

ah12068 pushed a commit to ah12068/OpenLineage that referenced this pull request Feb 3, 2026
…nLineage#4298)

The --target-path CLI flag was not being parsed from command line
arguments and passed to the DbtStructuredLogsProcessor and
DbtLocalArtifactProcessor constructors. This caused the processors
to always use the default target path instead of the user-specified one.

Signed-off-by: Gaurav Sahu <Gaurav.sahu@atlan.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
ah12068 pushed a commit to ah12068/OpenLineage that referenced this pull request Feb 3, 2026
…nLineage#4298)

The --target-path CLI flag was not being parsed from command line
arguments and passed to the DbtStructuredLogsProcessor and
DbtLocalArtifactProcessor constructors. This caused the processors
to always use the default target path instead of the user-specified one.

Signed-off-by: Gaurav Sahu <Gaurav.sahu@atlan.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
ah12068 pushed a commit to ah12068/OpenLineage that referenced this pull request Feb 3, 2026
…nLineage#4298)

The --target-path CLI flag was not being parsed from command line
arguments and passed to the DbtStructuredLogsProcessor and
DbtLocalArtifactProcessor constructors. This caused the processors
to always use the default target path instead of the user-specified one.

Signed-off-by: Gaurav Sahu <Gaurav.sahu@atlan.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Jeremy Dang <jeremy.dang@crugroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integration/dbt openlineage-dbt area:tests Testing code language:python Uses Python programming language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants