dstandish commented on code in PR #26848:
URL: https://github.com/apache/airflow/pull/26848#discussion_r991678283
##########
tests/providers/cncf/kubernetes/utils/test_pod_manager.py:
##########
@@ -331,6 +332,23 @@ def test_fetch_container_running_follow(
assert ret.last_log_time == DateTime(2021, 1, 1,
tzinfo=Timezone('UTC'))
assert ret.running is exp_running
+ def test_pod_manager_get_client_call_deprecation(self):
+ """Ensure that kube_client.get_kube_client is removed from pod manager
in provider 6.0."""
+ try:
+ from airflow.providers.cncf.kubernetes.utils.pod_manager import
get_kube_client # noqa
+ except ImportError:
+ raise Exception(
+ "You must remove this test. It only exists to remind us to
remove `get_kube_client`."
+ )
+ from airflow.providers_manager import ProvidersManager
+
+ info =
ProvidersManager().providers['apache-airflow-providers-cncf-kubernetes']
+ if semver.VersionInfo.parse(info.version) >= (6, 0):
Review Comment:
I see. that makes sense for the use case where the deprecation is removing a
function (or, i suppose, anything in globals()) but it might not be that simple
if removing a method or a param.
i don't think you'd need a lambda... you could just parametrize with the
import string, and supply it to `import_string`.
i tried to go with the spirit of your comment in the latest commit. test is
_marginally_ more readable. i reckon should be good enough for now!
could imagine parametrizing but... really the devil is in the details
--
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]