Vamsi-klu commented on code in PR #68144:
URL: https://github.com/apache/airflow/pull/68144#discussion_r3369969837
##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -50,6 +50,8 @@
HIVE_QUEUE_PRIORITIES = ["VERY_HIGH", "HIGH", "NORMAL", "LOW", "VERY_LOW"]
+HIVE_CLI_TRANSPORT_MODES = {"binary", "http"}
Review Comment:
Agreed — there's no good reason to special-case it. I removed the
`HIVE_CLI_TRANSPORT_MODES` constant, the form widget, and the
`_get_connection_jdbc_url_parameters` method. `transportMode` now goes through
`jdbc_params` like every other param, so there's a single sanctioned, validated
injection point.
##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -50,6 +50,8 @@
HIVE_QUEUE_PRIORITIES = ["VERY_HIGH", "HIGH", "NORMAL", "LOW", "VERY_LOW"]
+HIVE_CLI_TRANSPORT_MODES = {"binary", "http"}
+JDBC_PARAMETER_NAME_PATTERN = re.compile(r"^[A-Za-z][A-Za-z0-9._-]*$")
Review Comment:
Good catch — it could. I tightened the pattern to
`^[A-Za-z]([A-Za-z0-9._-]*[A-Za-z0-9])?$`, which still allows a single letter
but otherwise requires the name to end in a letter or digit, so
`transportMode-`, `foo.`, and `bar_` are now rejected. (Inside the character
class `.` and `-` are literal, so no escaping is needed.) Added tests for those
cases.
--
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]