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 2021/09/16 14:10:01 UTC

[GitHub] [airflow] ashb commented on a change in pull request #17682: Import Hooks lazily individually in providers manager

ashb commented on a change in pull request #17682:
URL: https://github.com/apache/airflow/pull/17682#discussion_r710156932



##########
File path: airflow/provider.yaml.schema.json
##########
@@ -195,11 +195,33 @@
     },
     "hook-class-names": {
       "type": "array",
-      "description": "Hook class names that provide connection types to core",
+      "description": "Hook class names that provide connection types to core (deprecated by connection-types)",
       "items": {
-        "type": "string"
+          "type": "string"
+      },
+      "deprecated": {
+        "description": "The hook-class-names property has been deprecated in favour of connection-types which is more performant version allowing to only import individual Hooks rather than all hooks at once",
+        "deprecatedVersion": "2.2"
       }
     },
+    "connection-types": {
+      "type": "array",
+      "description": "Map of connection types mapped to hook class names",

Review comment:
       @potiuk Was there a reason you have this as a list of dicts rather than just a map as originally documented?
   
   i.e. instead of this currently
   
   ```yaml
   connection-types:
     - hook-class-name: airflow.providers.airbyte.hooks.airbyte.AirbyteHook
       connection-type: airbyte
   ```
   
   why didn't we have
   
   ```
   connection-types:
     airbyte: hook-class-name: airflow.providers.airbyte.hooks.airbyte.AirbyteHook
   ```
   
   I'm only now looking at this PR (sorry!) now to take over Daniel's `@task.docker` decorator work. and I'd like to follow the similar same pattern here.
   
   I guess this is farily set in stone anyway as the providers with this pattern have been released haven't they?




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