kalluripradeep commented on code in PR #64391:
URL: https://github.com/apache/airflow/pull/64391#discussion_r3006561183
##########
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -545,9 +551,41 @@ def _resolve_kerberos_principal(self, principal: str |
None) -> str:
func = kerberos.get_kerberos_principal
except AttributeError:
# Fallback for older versions of Airflow
- func = kerberos.get_kerberos_principle # type:
ignore[attr-defined]
+ func = getattr(kerberos, "get_kerberos_principle")
Review Comment:
"Yes, exactly. Strict mypy and ruff static analysis kept failing the CI
because get_kerberos_principle (with the typo) doesn't explicitly exist on the
modern mocked stub during testing. getattr() safely bypasses this without
needing the # type: ignore."
--
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]