Skip to content

Conversation

@Arunodoy18
Copy link
Contributor

@Arunodoy18 Arunodoy18 commented Jan 4, 2026

Fixes #60059

The issue: Runtime errors during DAG parsing in GitDagBundle were being caught but not persisted to the import_error table, causing DAGs with errors to silently disappear from the UI instead of appearing under Import Errors. This was inconsistent with LocalDagBundle behavior.

Root cause: When DAG serialization failed in _serialize_dags(), the error was stored using dag.fileloc (absolute path) instead of dag.relative_fileloc (relative path). However, DagBag stores parse-time errors with relative paths, and the update_dag_parsing_results_in_db() function expects all import errors to be keyed by (bundle_name, relative_path) tuples.

This path inconsistency caused serialization errors to have absolute paths that couldn't be properly matched to their bundle context, resulting in failed DB inserts and silent failures.

Changes:

  1. Updated _serialize_dags() to use dag.relative_fileloc instead of dag.fileloc when storing serialization errors, ensuring consistency with parse-time errors
  2. Added test_serialization_errors_use_relative_paths() to verify serialization errors use relative paths across bundle types
  3. Added test_import_errors_persisted_with_relative_paths() to validate end-to-end error persistence for bundle-backed DAGs

This fix ensures that all DAG errors (parse-time and serialization-time) are consistently tracked and displayed in the UI, regardless of bundle type (Git, Local, S3, GCS, etc.).

Closes #60059

@Arunodoy18
Copy link
Contributor Author

This issue is now addressed in the linked PR. Requesting a review whenever convenient.

@Arunodoy18 Arunodoy18 changed the title Fix: Persist runtime errors from GitDagBundle to import_error table Fix: Persist import errors from GitDagBundle to import_error table Jan 4, 2026
@SameerMesiah97
Copy link
Contributor

SameerMesiah97 commented Jan 4, 2026

I believe it would be best to fix the issue reference in the description so that this PR can be automatically linked to it.

I will link it here now: #60059

@Arunodoy18
Copy link
Contributor Author

Thanks for pointing that out. I’ve updated the PR description to correctly reference the issue.

ephraimbuddy
ephraimbuddy previously approved these changes Jan 5, 2026
@ephraimbuddy ephraimbuddy dismissed their stale review January 5, 2026 09:15

Test is failing...

The issue: Runtime errors during DAG parsing in GitDagBundle were being caught
but not persisted to the import_error table, causing DAGs with errors to silently
disappear from the UI instead of appearing under Import Errors. This was inconsistent
with LocalDagBundle behavior.

Root cause: When DAG serialization failed in _serialize_dags(), the error was stored
using dag.fileloc (absolute path) instead of dag.relative_fileloc (relative path).
However, DagBag stores parse-time errors with relative paths, and the
update_dag_parsing_results_in_db() function expects all import errors to be keyed
by (bundle_name, relative_path) tuples.

This path inconsistency caused serialization errors to have absolute paths that
couldn't be properly matched to their bundle context, resulting in failed DB
inserts and silent failures.

Changes:
1. Updated _serialize_dags() to use dag.relative_fileloc instead of dag.fileloc
   when storing serialization errors, ensuring consistency with parse-time errors
2. Added test_serialization_errors_use_relative_paths() to verify serialization
   errors use relative paths across bundle types
3. Added test_import_errors_persisted_with_relative_paths() to validate end-to-end
   error persistence for bundle-backed DAGs

This fix ensures that all DAG errors (parse-time and serialization-time) are
consistently tracked and displayed in the UI, regardless of bundle type
(Git, Local, S3, GCS, etc.).

Fixes: #<issue_number>
@potiuk potiuk force-pushed the fix/gitdagbundle-import-error-persistence branch from bc6a092 to 718a059 Compare January 5, 2026 16:50
@potiuk
Copy link
Member

potiuk commented Jan 5, 2026

Test is failing...

Yep. rebased it but I guess tests will still fail

@kaxil
Copy link
Member

kaxil commented Jan 5, 2026

@Arunodoy18 I am going to close your PRs -- Please review and test your changes with correct PR description. Using LLMs without those increase maintenance burdens and CI run time.

Feel free to recreate focussed PRs following those guidelines.

@kaxil kaxil closed this Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import Errors are not persisted to DB (silent failure) when UnboundLocalError occurs in Git Bundles

5 participants