This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new ef0b840dddc strip url before parsing (#47347)
ef0b840dddc is described below

commit ef0b840dddc52d2a098dd5a7603d927244ffe1bf
Author: darkag <[email protected]>
AuthorDate: Tue Mar 4 16:08:58 2025 +0100

    strip url before parsing (#47347)
---
 airflow/utils/docs.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/airflow/utils/docs.py b/airflow/utils/docs.py
index 8f0cd10d9b9..a1217091c52 100644
--- a/airflow/utils/docs.py
+++ b/airflow/utils/docs.py
@@ -56,9 +56,11 @@ def get_doc_url_for_provider(provider_name: str, 
provider_version: str) -> str:
             for item in metadata_items:
                 if item.lower().startswith("documentation"):
                     _, _, url = item.partition(",")
-                    parsed_url = urlparse(url)
-                    if url and (parsed_url.scheme in ("http", "https") and 
bool(parsed_url.netloc)):
-                        return url.strip()
+                    if url:
+                        url = url.strip()
+                        parsed_url = urlparse(url)
+                        if url and (parsed_url.scheme in ("http", "https") and 
bool(parsed_url.netloc)):
+                            return url
     except metadata.PackageNotFoundError:
         pass
     # Fallback if provider is apache one

Reply via email to