Skip to content

Use relative path in ParseImportError.filename #51406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ephraimbuddy
Copy link
Contributor

@ephraimbuddy ephraimbuddy commented Jun 4, 2025

This aligns with our use of relative path in DAGs

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:DAG-processing labels Jun 4, 2025
@ephraimbuddy ephraimbuddy force-pushed the use-relative-fileloc-import-error branch 2 times, most recently from af0857a to 23f0643 Compare June 5, 2025 14:07
@ephraimbuddy ephraimbuddy marked this pull request as ready for review June 5, 2025 14:08
@ephraimbuddy ephraimbuddy force-pushed the use-relative-fileloc-import-error branch from 23f0643 to 5d40e93 Compare June 5, 2025 17:05
@ephraimbuddy ephraimbuddy requested a review from Copilot June 6, 2025 08:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aligns our usage of relative paths for import error filenames with our DAGs by updating the DAG model and related error handling logic while also bumping the uv version from 0.7.8 to 0.7.11.

  • Changed the type and default of relative_fileloc in the DAG model to ensure a non-null value for downstream processing.
  • Updated all references to use the relative_fileloc (as well as tuple‐based keys for error mappings) and bumped uv version settings across multiple files.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

File Description
task-sdk/src/airflow/sdk/definitions/dag.py Updated relative_fileloc type from Optional[str] to str with a default empty string.
scripts/, pyproject.toml, dev/breeze/, Dockerfile* Bumped uv version from 0.7.8 to 0.7.11.
airflow-core/* Updated error handling and database interactions to use relative_fileloc and tuple keys.
Comments suppressed due to low confidence (1)

task-sdk/src/airflow/sdk/definitions/dag.py:448

  • Changing relative_fileloc from an optional type to a non-nullable string with a default empty value may have downstream implications. Please confirm that an empty string is acceptable when no relative path can be determined or consider adding explicit handling for such cases.
relative_fileloc: str = attrs.field(init=False, default="")

@ephraimbuddy ephraimbuddy force-pushed the use-relative-fileloc-import-error branch 2 times, most recently from 38ed4f2 to 402a69d Compare June 10, 2025 12:42
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One small nit although not a blocker

@ephraimbuddy ephraimbuddy force-pushed the use-relative-fileloc-import-error branch from 402a69d to bf79346 Compare June 12, 2025 06:55
@ephraimbuddy ephraimbuddy merged commit 407753c into apache:main Jun 12, 2025
97 checks passed
@ephraimbuddy ephraimbuddy deleted the use-relative-fileloc-import-error branch June 12, 2025 11:44
@ephraimbuddy ephraimbuddy added this to the Airflow 3.1+ milestone Jun 12, 2025
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Jun 14, 2025
* Use relative path in ParseImportError.filename

This aligns with our use of relative path in DAGs

* fixup! Use relative path in ParseImportError.filename

* revert empty string default for relative_fileloc

* Fix typo and query explanatory comment

* Apply suggestions from code review

Co-authored-by: Tzu-ping Chung <[email protected]>

---------

Co-authored-by: Tzu-ping Chung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:DAG-processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants