vbottu commented on PR #61798: URL: https://github.com/apache/airflow/pull/61798#issuecomment-3889076220
**Note on `# type: ignore[assignment]` for `kube_image` in `kube_config.py`:** Switching config reads from `conf.get()` (AirflowConfigParser) to `self._conf.get()` (ExecutorConf) changes the return type mypy sees — `AirflowConfigParser.get()` has overloads that resolve to `str`, while `ExecutorConf.get()` returns `str | None`. This causes mypy to infer `worker_container_repository` and `worker_container_tag` as `str | None`, which then makes the `self.kube_image = f"..."` branch infer as `str` while the `else: self.kube_image = None` branch is rejected. The `type: ignore` preserves the exact same runtime and mypy behavior as the original code. The underlying type inconsistency is pre-existing: `kube_image` can be `None` at runtime, but `PodGenerator.construct_pod()` declares `kube_image: str`. Fixing this properly would require changing the `construct_pod` signature (out of scope for this PR). Notably, passing `None` here is intentional — the Kubernetes client omits `None` fields during serialization, whereas an empty string would produce `'image': ''` in the pod spec. -- 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]
