Skip to content

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

Pull Request Test Coverage Report for Build b0c34e8f-5b58-48fb-91dc-ee6de3b6c95d

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.15%

Totals Coverage Status
Change from base Build 63595748-3be8-42e5-8f39-9a30d684e069: 0.0%
Covered Lines: 20865
Relevant Lines: 62941

💛 - Coveralls

@jlaneve jlaneve marked this pull request as ready for review January 30, 2026 18:42
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.

2 participants