ashb commented on a change in pull request #3722: [AIRFLOW-2759] Add changes to 
extract proxy details at the base hook …
URL: https://github.com/apache/incubator-airflow/pull/3722#discussion_r208867658
 
 

 ##########
 File path: airflow/hooks/base_hook.py
 ##########
 @@ -88,6 +89,20 @@ def get_hook(cls, conn_id):
         connection = cls.get_connection(conn_id)
         return connection.get_hook()
 
+    def get_proxyconfig(self):
+        log = LoggingMixin().log
+        proxy_config = None
+        try:
+            conf_dict = configuration.as_dict(display_sensitive=False)
+            if conf_dict and 'proxy' in conf_dict:
+                proxy_config = conf_dict['proxy']
+            else:
+                log.error("Proxy section not found in config")
 
 Review comment:
   This isn't possible - you've added it to the default config so it will 
always be there.
   
   Additionally don't use `as_dict` - there's `getsection` for this purpose

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to