Vamsi-klu commented on code in PR #68144:
URL: https://github.com/apache/airflow/pull/68144#discussion_r3369969925


##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -141,6 +148,9 @@ def get_connection_form_widgets(cls) -> dict[str, Any]:
             ),
             "high_availability": BooleanField(lazy_gettext("High Availability 
mode"), default=False),
             "ssl": BooleanField(lazy_gettext("Ssl"), default=True),
+            "transport_mode": StringField(
+                lazy_gettext("Transport Mode"), widget=BS3TextFieldWidget(), 
default=""

Review Comment:
   Removed — this widget was part of the `transport_mode` connection-extra 
special-casing, which is gone. `transportMode` is now just another 
`jdbc_params` entry.
   



##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -212,6 +223,55 @@ def _prepare_cli_cmd(self) -> list[Any]:
 
         return [hive_bin, *cmd_extra, *hive_params_list]
 
+    def _get_jdbc_url_parameters(self) -> dict[str, str]:
+        jdbc_params = self._get_connection_jdbc_url_parameters()
+        
jdbc_params.update(self._validate_jdbc_url_parameters(self.jdbc_params))
+        return jdbc_params
+
+    def _get_connection_jdbc_url_parameters(self) -> dict[str, str]:
+        extra_dejson = getattr(self.conn, "extra_dejson", {})
+        transport_mode = extra_dejson.get("transport_mode")
+        if not transport_mode:
+            return {}
+        transport_mode = str(transport_mode).lower()
+        if transport_mode not in HIVE_CLI_TRANSPORT_MODES:
+            allowed_modes = ", ".join(sorted(HIVE_CLI_TRANSPORT_MODES))
+            raise ValueError(f"The transport_mode connection extra should be 
one of: {allowed_modes}")
+        return {"transportMode": transport_mode}

Review Comment:
   Right — that was a side effect of the connection-extra special-casing, which 
I've now removed. There's no longer a connection-level transport-mode path; all 
JDBC params (including `transportMode`) come through `jdbc_params`.
   
   



-- 
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]

Reply via email to