eddiesr93 opened a new pull request, #70099: URL: https://github.com/apache/airflow/pull/70099
Enable `PythonVirtualenvOperator` and `ExternalPythonOperator` callables to opt into the current task context through `airflow.sdk.get_current_context()`. The parent process serializes the supported context fields, and the subprocess restores them with the SDK context manager for the duration of the callable. The option remains disabled by default and validates that Airflow 3 is available in the target environment. This also removes the obsolete AIP-72 test exclusions and documents both operators. This restores the feature tracked in #46361 now that Airflow 3 context serialization can safely carry the required SDK objects. Validation: - `uv run --frozen --project providers/standard pytest providers/standard/tests/unit/standard/operators/test_python.py -k 'current_context or use_airflow_context' -q` (8 passed) - `uv run --frozen prek --files ...` for all changed files closes: #46361 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex (GPT-5) Generated-by: Codex (GPT-5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: Codex (GPT-5) (no human review before posting) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
