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 2019/05/28 10:37:23 UTC

[GitHub] [airflow] ashb commented on a change in pull request #5239: [WIP][AIRFLOW-2910] Add HTTP URI support

ashb commented on a change in pull request #5239: [WIP][AIRFLOW-2910] Add HTTP URI support
URL: https://github.com/apache/airflow/pull/5239#discussion_r288037034
 
 

 ##########
 File path: airflow/models/connection.py
 ##########
 @@ -128,6 +128,27 @@ def __init__(
 
     def parse_from_uri(self, uri):
         uri_parts = urlparse(uri)
+        if uri_parts.scheme in ['http', 'https']:
+            self._parse_from_http_uri(uri)
+        else:
+            self._parse_from_airflow_uri(uri)
+
+    def _parse_from_http_uri(self, uri):
+        self.conn_type = 'http'
+        url_parts = urlparse(uri)
+        netloc = "%s:%s" % (url_parts.hostname, url_parts.port) if url_parts.port else url_parts.hostname
+        # The fragment is used to store extra configuration. The HTTP client never uses fragments, so
 
 Review comment:
   This needs documenting somewhere that end users will be able to see without finding this bit of the code.

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


With regards,
Apache Git Services