Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Skip PodGenerator import for deserialization when no k8s installed#56733

Merged
kaxil merged 3 commits intoapache:mainfrom
potiuk:fix-k8s-deserialization
Oct 16, 2025
Merged

Skip PodGenerator import for deserialization when no k8s installed#56733
kaxil merged 3 commits intoapache:mainfrom
potiuk:fix-k8s-deserialization

Conversation

Copy link
Member

potiuk commented Oct 16, 2025

The #56692 introduced optimization for PodGenerator imports - but there was a problem that when deserializing Pod it failed when no k8s classes were loaded - but it really is not optimisation but failure - nothing actually prevents us from importing the k8s classes and we actually have to do it in case we want to deserialize serialized Pod.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

potiuk added this to the Airflow 3.1.1 milestone Oct 16, 2025
potiuk requested review from ashb and bolkedebruin as code owners October 16, 2025 16:34
potiuk added full tests needed We need to run full set of tests for this PR to merge backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Oct 16, 2025
boring-cyborg bot added the area:serialization label Oct 16, 2025
potiuk requested review from amoghrajesh, gopidesupavan and kaxil October 16, 2025 16:35
kaxil approved these changes Oct 16, 2025
amoghrajesh approved these changes Oct 16, 2025
gopidesupavan approved these changes Oct 16, 2025
kaxil reviewed Oct 16, 2025
The apache#56692 introduced optimization for PodGenerator imports - but there
was a problem that when deserializing Pod it failed when no k8s classes
were loaded - but it really is not optimisation but failure - nothing
actually prevents us from importing the k8s classes and we actually have
to do it in case we want to deserialize serialized Pod. # Please enter
the commit message for your changes. Lines starting
potiuk force-pushed the fix-k8s-deserialization branch from 6365b18 to 78407dd Compare October 16, 2025 17:56
potiuk changed the title Lazy import PodGenerator for deserialization Skip PodGenerator import for deserialization when no k8s installed Oct 16, 2025
Copy link
Member

kaxil commented Oct 16, 2025

The log failures seems to be a different issue:

. at 0x7f9cbe544dd0>) tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py:81: AssertionError =============================== warnings summary =============================== ../.venv/lib/python3.10/site-packages/testcontainers/core/wa iting_utils.py:215 /home/runner/work/airflow/airflow/.venv/lib/python3.10/site- packages/testcontainers/core/waiting_utils.py:215: DeprecationWarning: The @wait_container_is_ready decorator is deprecated and will be removed in a future version. Use structured wait strategies instead: container.waiting_for(HttpWaitStrategy(8080).for_status_code (200)) or container.waiting_for(LogMessageWaitStrategy('ready')) @wait_container_is_ready() -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.ht ml =========================== short test summary info ============================ FAILED tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py::TestRemoteLogging::test_remote_logging_s3 - AssertionError: None of the log sources ['/opt/airflow/logs/dag_id=example_xcom_test/run_id=manual__ 2025-10-16T19:00:48.103160+00:00/task_id=bash_pull/attempt=1 .log'] were found in S3 bucket logs ['s3://test-airflow-logs/dag_id=example_xcom_test/run_id=man ual__2025-10-16T19:00:48.103160+00:00/task_id=bash_push/atte mpt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=pull_value_from _bash_push/attempt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=puller/attempt= 1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push/attempt=1. log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push_by_returni ng/attempt=1.log'] assert False + where False = any(. at 0x7f9cbe544dd0>)">E AssertionError: None of the log sources ['/opt/airflow/logs/dag_id=example_xcom_test/run_id=manual__ 2025-10-16T19:00:48.103160+00:00/task_id=bash_pull/attempt=1 .log'] were found in S3 bucket logs ['s3://test-airflow-logs/dag_id=example_xcom_test/run_id=man ual__2025-10-16T19:00:48.103160+00:00/task_id=bash_push/atte mpt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=pull_value_from _bash_push/attempt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=puller/attempt= 1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push/attempt=1. log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manual__2025-10-16T19:00:48.103160+00:00/task_id=push_by_returning/attempt=1.log']
E assert False
E + where False = any(. at 0x7f9cbe544dd0>)

tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py:81: AssertionError
=============================== warnings summary ===============================
../.venv/lib/python3.10/site-packages/testcontainers/core/waiting_utils.py:215
/home/runner/work/airflow/airflow/.venv/lib/python3.10/site- packages/testcontainers/core/waiting_utils.py:215: DeprecationWarning: The @wait_container_is_ready decorator is deprecated and will be removed in a future version. Use structured wait strategies instead: container.waiting_for(HttpWaitStrategy(8080).for_status_code (200)) or container.waiting_for(LogMessageWaitStrategy('ready'))
@wait_container_is_ready()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py::TestRemoteLogging::test_remote_logging_s3 - AssertionError: None of the log sources ['/opt/airflow/logs/dag_id=example_xcom_test/run_id=manual__ 2025-10-16T19:00:48.103160+00:00/task_id=bash_pull/attempt=1 .log'] were found in S3 bucket logs ['s3://test-airflow-logs/dag_id=example_xcom_test/run_id=man ual__2025-10-16T19:00:48.103160+00:00/task_id=bash_push/atte mpt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=pull_value_from _bash_push/attempt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=puller/attempt= 1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push/attempt=1. log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manual__2025-10-16T19:00:48.103160+00:00/task_id=push_by_returning/attempt=1.log']
assert False
+ where False = any(. at 0x7f9cbe544dd0>)

cc @gopidesupavan if you have ideas

kaxil merged commit 17037e6 into apache:main Oct 16, 2025
109 of 110 checks passed
Copy link
Member Author

potiuk commented Oct 16, 2025

Yeah. Just looked :)

Copy link

github-actions bot commented Oct 16, 2025

Backport failed to create: v3-1-test. View the failure log Run details

Status Branch Result
v3-1-test

You can attempt to backport this manually by running:

cherry_picker 17037e6 v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

Copy link
Member

gopidesupavan commented Oct 16, 2025 *
edited
Loading

The log failures seems to be a different issue:

. at 0x7f9cbe544dd0>) tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py:81: AssertionError =============================== warnings summary =============================== ../.venv/lib/python3.10/site-packages/testcontainers/core/wa iting_utils.py:215 /home/runner/work/airflow/airflow/.venv/lib/python3.10/site- packages/testcontainers/core/waiting_utils.py:215: DeprecationWarning: The @wait_container_is_ready decorator is deprecated and will be removed in a future version. Use structured wait strategies instead: container.waiting_for(HttpWaitStrategy(8080).for_status_code (200)) or container.waiting_for(LogMessageWaitStrategy('ready')) @wait_container_is_ready() -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.ht ml =========================== short test summary info ============================ FAILED tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py::TestRemoteLogging::test_remote_logging_s3 - AssertionError: None of the log sources ['/opt/airflow/logs/dag_id=example_xcom_test/run_id=manual__ 2025-10-16T19:00:48.103160+00:00/task_id=bash_pull/attempt=1 .log'] were found in S3 bucket logs ['s3://test-airflow-logs/dag_id=example_xcom_test/run_id=man ual__2025-10-16T19:00:48.103160+00:00/task_id=bash_push/atte mpt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=pull_value_from _bash_push/attempt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=puller/attempt= 1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push/attempt=1. log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push_by_returni ng/attempt=1.log'] assert False + where False = any(. at 0x7f9cbe544dd0>)">E AssertionError: None of the log sources ['/opt/airflow/logs/dag_id=example_xcom_test/run_id=manual__ 2025-10-16T19:00:48.103160+00:00/task_id=bash_pull/attempt=1 .log'] were found in S3 bucket logs ['s3://test-airflow-logs/dag_id=example_xcom_test/run_id=man ual__2025-10-16T19:00:48.103160+00:00/task_id=bash_push/atte mpt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=pull_value_from _bash_push/attempt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=puller/attempt= 1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push/attempt=1. log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manual__2025-10-16T19:00:48.103160+00:00/task_id=push_by_returning/attempt=1.log']
E assert False
E + where False = any(. at 0x7f9cbe544dd0>)

tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py:81: AssertionError
=============================== warnings summary ===============================
../.venv/lib/python3.10/site-packages/testcontainers/core/waiting_utils.py:215
/home/runner/work/airflow/airflow/.venv/lib/python3.10/site- packages/testcontainers/core/waiting_utils.py:215: DeprecationWarning: The @wait_container_is_ready decorator is deprecated and will be removed in a future version. Use structured wait strategies instead: container.waiting_for(HttpWaitStrategy(8080).for_status_code (200)) or container.waiting_for(LogMessageWaitStrategy('ready'))
@wait_container_is_ready()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/airflow_e2e_tests/remote_log_tests/test_remote_logging .py::TestRemoteLogging::test_remote_logging_s3 - AssertionError: None of the log sources ['/opt/airflow/logs/dag_id=example_xcom_test/run_id=manual__ 2025-10-16T19:00:48.103160+00:00/task_id=bash_pull/attempt=1 .log'] were found in S3 bucket logs ['s3://test-airflow-logs/dag_id=example_xcom_test/run_id=man ual__2025-10-16T19:00:48.103160+00:00/task_id=bash_push/atte mpt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=pull_value_from _bash_push/attempt=1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=puller/attempt= 1.log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manu al__2025-10-16T19:00:48.103160+00:00/task_id=push/attempt=1. log', 's3://test-airflow-logs/dag_id=example_xcom_test/run_id=manual__2025-10-16T19:00:48.103160+00:00/task_id=push_by_returning/attempt=1.log']
assert False
+ where False = any(. at 0x7f9cbe544dd0>)

cc @gopidesupavan if you have ideas

huh thats strange looks like logs endpoint returning local log location instead of remote location, though we have already configured remote logging.

Will take a look.

kaxil reacted with thumbs up emoji

abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 17, 2025
The apache#56692 introduced optimization for PodGenerator imports - but there
was a problem that when deserializing Pod it failed when no k8s classes
were loaded - but it really is not optimisation but failure - nothing
actually prevents us from importing the k8s classes and we actually have
to do it in case we want to deserialize serialized Pod. # Please enter
the commit message for your changes. Lines starting

* fixup! Skip PodGenerator import for deserialization when no k8s installed

* fixup! fixup! Skip PodGenerator import for deserialization when no k8s installed

---------

Co-authored-by: Kaxil Naik
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 19, 2025
The apache#56692 introduced optimization for PodGenerator imports - but there
was a problem that when deserializing Pod it failed when no k8s classes
were loaded - but it really is not optimisation but failure - nothing
actually prevents us from importing the k8s classes and we actually have
to do it in case we want to deserialize serialized Pod. # Please enter
the commit message for your changes. Lines starting

* fixup! Skip PodGenerator import for deserialization when no k8s installed

* fixup! fixup! Skip PodGenerator import for deserialization when no k8s installed

---------

Co-authored-by: Kaxil Naik
kaxil added a commit that referenced this pull request Oct 21, 2025
The #56692 introduced optimization for PodGenerator imports - but there
was a problem that when deserializing Pod it failed when no k8s classes
were loaded - but it really is not optimisation but failure - nothing
actually prevents us from importing the k8s classes and we actually have
to do it in case we want to deserialize serialized Pod. # Please enter
the commit message for your changes. Lines starting

* fixup! Skip PodGenerator import for deserialization when no k8s installed

* fixup! fixup! Skip PodGenerator import for deserialization when no k8s installed

---------

Co-authored-by: Kaxil Naik
(cherry picked from commit 17037e6)
TyrellHaywood pushed a commit to TyrellHaywood/airflow that referenced this pull request Oct 22, 2025
The apache#56692 introduced optimization for PodGenerator imports - but there
was a problem that when deserializing Pod it failed when no k8s classes
were loaded - but it really is not optimisation but failure - nothing
actually prevents us from importing the k8s classes and we actually have
to do it in case we want to deserialize serialized Pod. # Please enter
the commit message for your changes. Lines starting

* fixup! Skip PodGenerator import for deserialization when no k8s installed

* fixup! fixup! Skip PodGenerator import for deserialization when no k8s installed

---------

Co-authored-by: Kaxil Naik
potiuk mentioned this pull request Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

kaxil kaxil approved these changes

gopidesupavan gopidesupavan approved these changes

amoghrajesh amoghrajesh approved these changes

ashb Awaiting requested review from ashb ashb is a code owner

bolkedebruin Awaiting requested review from bolkedebruin bolkedebruin is a code owner

Assignees

No one assigned

Labels

area:serialization backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Milestone

Airflow 3.1.1

Development

Successfully merging this pull request may close these issues.

4 participants