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 2020/11/23 14:14:15 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #12472: Add extra links to providers

mik-laj commented on a change in pull request #12472:
URL: https://github.com/apache/airflow/pull/12472#discussion_r528731278



##########
File path: airflow/providers/google/provider.yaml
##########
@@ -633,3 +633,8 @@ transfers:
   - source-integration-name: Google Ads
     target-integration-name: Google Cloud Storage (GCS)
     python-module: airflow.providers.google.ads.transfers.ads_to_gcs
+
+extra-links:
+  - airflow.providers.google.cloud.operators.bigquery.BigQueryConsoleLink
+  - airflow.providers.google.cloud.operators.bigquery.BigQueryConsoleIndexableLink
+  - airflow.providers.google.cloud.operators.mlengine.AIPlatformConsoleLink

Review comment:
       I prefer to use full import paths for several reasons: 
   1) a) when you want to use it, you can easily do it without transforming these values. 
      ```
      value = "airflow.providers.google.cloud.operators.mlengine.AIPlatformConsoleLink"
      importlib.import_module(value)
      ```
   2) it is easier to find all references to a given class if we use the full path.  I often right-click on a class and copy the reference so that I can search for it in the code.  This way I can easily find class references that are not in the code, e.g. in mocks or documentation.
       <img width="738" alt="Screenshot 2020-11-23 at 15 08 01" src="https://user-images.githubusercontent.com/12058428/99971605-b4b7ec80-2d9d-11eb-965b-2a48e36ffee1.png">
       <img width="845" alt="Screenshot 2020-11-23 at 15 09 52" src="https://user-images.githubusercontent.com/12058428/99971794-f6489780-2d9d-11eb-8025-e4a089a35273.png">
   3) We don't commonly use relative path imports in a project, so this convention may not be obvious to a new contributor. The full path is easier for new people to understand.
   
   It is no problem to perform the necessary validation in the code and display a readable error message when there is a problem. A readable message will be friendlier than a less common convention.
   
   What do you think about it?
   
   
    
       




----------------------------------------------------------------
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.

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