Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk 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 potiuk added this to the Airflow 3.1.1 milestone Oct 16, 2025
@potiuk 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
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 potiuk force-pushed the fix-k8s-deserialization branch from 6365b18 to 78407dd Compare October 16, 2025 17:56
@potiuk potiuk changed the title Lazy import PodGenerator for deserialization Skip PodGenerator import for deserialization when no k8s installed Oct 16, 2025
@kaxil
Copy link
Member

kaxil commented Oct 16, 2025

The log failures seems to be a different issue:

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=manual__2025-10-16T19:00:48.103160+00:00/task_id=bash_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=pull_value_from_bash_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=puller/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/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(<generator object TestRemoteLogging.test_remote_logging_s3.<locals>.<genexpr> 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=manual__2025-10-16T19:00:48.103160+00:00/task_id=bash_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=pull_value_from_bash_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=puller/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/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(<generator object TestRemoteLogging.test_remote_logging_s3.<locals>.<genexpr> at 0x7f9cbe544dd0>)

cc @gopidesupavan if you have ideas

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

potiuk commented Oct 16, 2025

Yeah. Just looked :)

@github-actions
Copy link

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

Status Branch Result
v3-1-test Commit Link

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

@gopidesupavan
Copy link
Member

gopidesupavan commented Oct 16, 2025

The log failures seems to be a different issue:

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=manual__2025-10-16T19:00:48.103160+00:00/task_id=bash_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=pull_value_from_bash_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=puller/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/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(<generator object TestRemoteLogging.test_remote_logging_s3.<locals>.<genexpr> 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=manual__2025-10-16T19:00:48.103160+00:00/task_id=bash_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=pull_value_from_bash_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=puller/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/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(<generator object TestRemoteLogging.test_remote_logging_s3.<locals>.<genexpr> 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.

abdulrahman305 bot pushed a commit to abdulrahman305/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 <kaxilnaik@gmail.com>
abdulrahman305 bot pushed a commit to abdulrahman305/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 <kaxilnaik@gmail.com>
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 <kaxilnaik@gmail.com>
(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 <kaxilnaik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

Development

Successfully merging this pull request may close these issues.

4 participants