You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/14 12:20:13 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #23012: Fallback Provider's doc URL to "Documentation" meta-data

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


##########
airflow/utils/docs.py:
##########
@@ -35,4 +40,20 @@ def get_docs_url(page: Optional[str] = None) -> str:
 
 def get_doc_url_for_provider(provider_name: str, provider_version: str) -> str:
     """Prepare link to Airflow Provider documentation."""
-    return f'https://airflow.apache.org/docs/{provider_name}/{provider_version}/'
+    try:
+        metadata_items = importlib_metadata.metadata(provider_name).get_all("Project-URL")
+        if isinstance(metadata_items, str):

Review Comment:
   You should report that as a bug. This does not sound right to me though, `get_all` is inherited from `email.message`, and AFAIK `get_all` always returns a list (unless `failobj` is returned, which is not the case here).
   
   https://docs.python.org/3/library/email.message.html#email.message.EmailMessage.get_all



-- 
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-unsubscribe@airflow.apache.org

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