prime-rate-matt commented on code in PR #77068:
URL: https://github.com/apache/airflow/pull/77068#discussion_r4579132790
##########
providers/snowflake/tests/unit/snowflake/hooks/test_snowflake.py:
##########
@@ -2252,14 +2252,58 @@ def
test_get_conn_passes_workload_identity_provider_to_connect(self):
assert call_kwargs["authenticator"] == "WORKLOAD_IDENTITY"
assert call_kwargs["workload_identity_provider"] == "GCP"
- def
test_get_connection_form_widgets_exposes_workload_identity_provider(self):
- """The connection form must expose a workload_identity_provider field
so users can set it in the UI."""
+ @pytest.mark.parametrize("field", ["workload_identity_provider",
"authenticator"])
+ def test_get_connection_form_widgets_exposes_auth_fields(self, field):
+ """The connection form must expose auth fields so users can set them
in the UI."""
pytest.importorskip("flask_appbuilder")
pytest.importorskip("flask_babel")
widgets = SnowflakeHook.get_connection_form_widgets()
- assert "workload_identity_provider" in widgets
+ assert field in widgets
+
+ @pytest.mark.parametrize(
+ ("extra_authenticator", "hook_authenticator", "expected"),
+ [
+ pytest.param(None, None, "WORKLOAD_IDENTITY", id="inferred"),
+ pytest.param("", None, "WORKLOAD_IDENTITY",
id="inferred-from-blank-form-field"),
+ pytest.param("oauth", None, "oauth", id="explicit-extra-wins"),
+ pytest.param(None, "snowflake", "snowflake",
id="explicit-hook-kwarg-wins"),
Review Comment:
My computer tells me to forward this message
> Thanks! I'd rather leave this one out: hook-kwarg-over-extra precedence is
pre-existing (self.authenticator or authenticator) and unchanged by this PR, so
the case would pass with or without the change. The PR's new interaction (a
hook kwarg beating the inferred WORKLOAD_IDENTITY) is covered by
explicit-hook-kwarg-wins.
It says it is against the repository policy to add tests to existing
functionality.
--
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]