hussein-awala commented on code in PR #33289:
URL: https://github.com/apache/airflow/pull/33289#discussion_r1290468426
##########
airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -143,7 +143,9 @@ def format_url(host: str) -> str:
parsed_url = urlparse(host)
# Check if the scheme is either http or https
- if not parsed_url.scheme:
+ # the second condition handles the Python 3.9+ case where urlparse
understands "localhost:9200"
+ # differently than urlparse in Python 3.8 and below
(https://github.com/psf/requests/issues/6455)
+ if not parsed_url.scheme or (parsed_url.scheme not in ("http",
"https") and not parsed_url.netloc):
Review Comment:
Do you have an example for a case where `parsed_url.scheme` not in ("http",
"https") and `parsed_url.netloc` is empty or None?
--
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]