kaxil commented on code in PR #77565:
URL: https://github.com/apache/airflow/pull/77565#discussion_r4697096568
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py:
##########
@@ -529,8 +530,8 @@ def _build_base_conn_config(
schema = conn.schema or ""
- # authenticator and session_parameters never supported long name
- authenticator = extra_dict.get("authenticator", "snowflake")
+ authenticator = self._get_field(extra_dict, "authenticator") or
"snowflake"
Review Comment:
Now that this is free text, `OAUTH` or `PROGRAMMATIC_ACCESS_TOKEN` is an
easy thing to type (the placeholder already mixes cases with
`WORKLOAD_IDENTITY`). The connector uppercases it and accepts either, but the
hook's `== "oauth"` / `!= "programmatic_access_token"` checks (and the two in
`_rest_auth.py`) don't match, so the token setup is skipped. Should this
normalise the value here, e.g. `.strip()` and compare case-insensitively like
`_rest_auth.py` already does for `WORKLOAD_IDENTITY`?
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py:
##########
@@ -303,6 +303,7 @@ def get_connection_form_widgets(cls) -> dict[str, Any]:
"database": StringField(lazy_gettext("Database"),
widget=BS3TextFieldWidget()),
"region": StringField(lazy_gettext("Region"),
widget=BS3TextFieldWidget()),
"role": StringField(lazy_gettext("Role"),
widget=BS3TextFieldWidget()),
+ "authenticator": StringField(lazy_gettext("Authenticator"),
widget=BS3TextFieldWidget()),
Review Comment:
The provider still supports 2.11, and the 2.x FAB form deletes an Extra JSON
key on save when the custom field with the same name is blank
(`ConnectionModelView.process_form`). So a 2.x user who follows
`connections/snowflake.rst` and puts `authenticator` in Extra now loses it and
falls back to `snowflake`, which is the failure this PR is fixing. Could the
docs (`snowflake.rst`, `cortex_agent.rst`, `pydantic_ai_snowflake.rst`) point
at the new Authenticator field instead of Extra?
--
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]