Nataneljpwd commented on code in PR #68144:
URL: https://github.com/apache/airflow/pull/68144#discussion_r3396511153
##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -212,6 +220,23 @@ def _prepare_cli_cmd(self) -> list[Any]:
return [hive_bin, *cmd_extra, *hive_params_list]
+ def _append_jdbc_params(self, jdbc_url: str) -> str:
+ if not self.jdbc_params:
+ return jdbc_url
+ segments = []
+ for name, value in self.jdbc_params.items():
+ if not isinstance(name, str) or not
JDBC_PARAMETER_NAME_PATTERN.fullmatch(name):
+ raise ValueError(
+ f"Invalid JDBC parameter name {name!r}: must match
{JDBC_PARAMETER_NAME_PATTERN.pattern}"
+ )
+ if value is None or ";" in str(value):
Review Comment:
What if the value is an empty string? Wouldn't we want to ignore it?
##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -212,6 +220,23 @@ def _prepare_cli_cmd(self) -> list[Any]:
return [hive_bin, *cmd_extra, *hive_params_list]
+ def _append_jdbc_params(self, jdbc_url: str) -> str:
+ if not self.jdbc_params:
+ return jdbc_url
+ segments = []
+ for name, value in self.jdbc_params.items():
+ if not isinstance(name, str) or not
JDBC_PARAMETER_NAME_PATTERN.fullmatch(name):
+ raise ValueError(
+ f"Invalid JDBC parameter name {name!r}: must match
{JDBC_PARAMETER_NAME_PATTERN.pattern}"
+ )
+ if value is None or ";" in str(value):
Review Comment:
Also can value be not of type string? Or number? Can it be a dict?
--
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]