kaxil commented on code in PR #65407:
URL: https://github.com/apache/airflow/pull/65407#discussion_r3153691426
##########
airflow-core/tests/unit/serialization/test_serialized_objects.py:
##########
@@ -1037,3 +1037,26 @@ def test_has_kubernetes_uses_existing_import(self):
result = _has_kubernetes()
assert result is True
+
+ def test_serialize_v1pod_attempts_import_before_serializing(self,
monkeypatch):
+ """Regression test: V1Pod serialization must call
_has_kubernetes(attempt_import=True)."""
+ k8s = pytest.importorskip("kubernetes.client.models")
+ from airflow.providers.cncf.kubernetes.pod_generator import
PodGenerator
+ from airflow.serialization import serialized_objects
Review Comment:
Minor: this one doesn't need to be inline. `airflow.serialization` is pure
airflow-core (no kubernetes / cncf-provider gate), so it doesn't need to sit
after the `pytest.importorskip` on line 1043. Could move to module top
alongside the existing `BaseSerialization` import. The line above
(`PodGenerator`) does need to stay inline since the cncf provider isn't a hard
dep of this file.
--
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]