dabla commented on code in PR #61103:
URL: https://github.com/apache/airflow/pull/61103#discussion_r2730519871
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/msgraph.py:
##########
@@ -160,13 +160,26 @@ def __init__(
self.conn_id = conn_id
self.timeout = timeout
self.proxies = proxies
- self.host = host
+ self.host = self._ensure_protocol(host) if host else None
if isinstance(scopes, str):
self.scopes = [scopes]
else:
self.scopes = scopes or [self.DEFAULT_SCOPE]
self.api_version = self.resolve_api_version_from_value(api_version)
+ def _ensure_protocol(self, url: str) -> str:
+ if not url:
+ return url
+ if url.startswith(("http://", "https://")):
+ return url
+
+ self.log.warning(
+ "URL '%s' is missing protocol prefix. Automatically adding
'https://'. "
+ "Please update your connection configuration to include the full
URL with protocol.",
+ url,
+ )
+ return f"https://{url}"
Review Comment:
Here I would add scheme like it was originally:
```
schema = connection.schema or "https"
return f"{schema}://{host}"
```
--
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]