uranusjr commented on code in PR #34118:
URL: https://github.com/apache/airflow/pull/34118#discussion_r1316560874


##########
airflow/providers/microsoft/azure/hooks/wasb.py:
##########
@@ -173,8 +173,8 @@ def get_conn(self) -> BlobServiceClient:
                 # provided the DNS name without the https:// prefix.
                 # Azure storage account name can only be 3 to 24 characters in 
length
                 # 
https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview#storage-account-name
-                acc_name = account_url.split(".")[0][:24]
-                account_url = f"https://{acc_name}."; + 
".".join(account_url.split(".")[1:])
+                acc_name, acc_url = account_url.split(".", 1)
+                account_url = f"https://{acc_name[:24]}.{acc_url}";

Review Comment:
   This logic would produce a URL with a trailing dot if the original URL does 
not contain any dots. But the original implementation already has this problem 
so I’m not sure if we want to fix it here.



##########
airflow/providers/microsoft/azure/hooks/wasb.py:
##########
@@ -173,8 +173,8 @@ def get_conn(self) -> BlobServiceClient:
                 # provided the DNS name without the https:// prefix.
                 # Azure storage account name can only be 3 to 24 characters in 
length
                 # 
https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview#storage-account-name
-                acc_name = account_url.split(".")[0][:24]
-                account_url = f"https://{acc_name}."; + 
".".join(account_url.split(".")[1:])
+                acc_name, acc_url = account_url.split(".", 1)
+                account_url = f"https://{acc_name[:24]}.{acc_url}";

Review Comment:
   This logic would produce a URL with a trailing dot if the original URL does 
not contain any dots. But the original implementation already has this problem 
so I’m not sure if we want to fix it here.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to