Skip to content

[PM-804] fix(parse): support airflow.sdk Variable in astro dev parse#2003

Open
jlaneve wants to merge 3 commits intomainfrom
agent/pm-804
Open

[PM-804] fix(parse): support airflow.sdk Variable in astro dev parse#2003
jlaneve wants to merge 3 commits intomainfrom
agent/pm-804

Conversation

@jlaneve
Copy link
Contributor

@jlaneve jlaneve commented Jan 30, 2026

Summary

  • Extends the Variable.get monkey patch to also apply to airflow.sdk.Variable
  • Ensures astro dev parse works correctly for DAGs using the new Airflow 3.x recommended import style (from airflow.sdk import Variable)
  • Fixes "Variable not found" errors when using remote backends like Azure Key Vault during parse

Context

Customer upgrading from Airflow 3.1.2 to 3.1.3 was blocked because astro dev parse fails when DAGs use airflow.sdk Variable.get with Azure Key Vault as the backend.

The existing test harness only monkey-patched airflow.models.Variable.get, so when imports are updated to use airflow.sdk (the new recommended approach in Airflow 3.x), the parse step makes real calls and fails with Variable not found.

Test plan

  • Verify astro dev parse works with DAGs using from airflow.sdk import Variable
  • Verify astro dev parse still works with DAGs using from airflow.models import Variable
  • Test with Airflow 3.1.3+ Runtime image

🤖 Generated with Claude Code

Astro Code Agent and others added 2 commits January 30, 2026 18:19
When DAGs use the new Airflow 3.x recommended import style
`from airflow.sdk import Variable`, the existing monkey patch for
`airflow.models.Variable.get` was not being applied. This caused
`astro dev parse` to fail with "Variable not found" errors when using
remote backends like Azure Key Vault.

This fix extends the Variable.get monkey patch to also apply to
`airflow.sdk.Variable`, ensuring DAG parsing works correctly for both
the legacy `airflow.models.Variable` and the new `airflow.sdk.Variable`
import styles.

Fixes PM-804

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coveralls-official
Copy link

coveralls-official bot commented Jan 30, 2026

Pull Request Test Coverage Report for Build ca25f6ef-09ee-4b86-8f62-56da18f6a541

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 33.153%

Totals Coverage Status
Change from base Build 055b4403-e142-4b85-a4c3-69b561e6393f: 0.0%
Covered Lines: 20868
Relevant Lines: 62944

💛 - Coveralls

@jlaneve jlaneve marked this pull request as ready for review January 30, 2026 18:42
@jlaneve jlaneve requested a review from a team as a code owner February 7, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant