xchwan commented on code in PR #55749:
URL: https://github.com/apache/airflow/pull/55749#discussion_r2357076778
##########
providers/trino/src/airflow/providers/trino/assets/trino.py:
##########
@@ -26,6 +26,10 @@
def sanitize_uri(uri: SplitResult) -> SplitResult:
if not uri.netloc:
raise ValueError("URI format trino:// must contain a host")
+ try:
+ _ = uri.port
+ except ValueError:
+ raise ValueError("URI format trino:// must contain a valid port")
if uri.port is None:
Review Comment:
If I don't add this part. The test for port not number will raise
"ValueError: Port could not be cast to integer value as 'abcd'", which is total
different with other ValueError that I can't match.
--
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]