potiuk commented on a change in pull request #4523: [AIRFLOW-3616] Add aliases
for schema with underscore
URL: https://github.com/apache/airflow/pull/4523#discussion_r249382288
##########
File path: airflow/models/connection.py
##########
@@ -109,22 +109,24 @@ def __init__(
self.extra = extra
def parse_from_uri(self, uri):
- temp_uri = urlparse(uri)
- hostname = temp_uri.hostname or ''
- conn_type = temp_uri.scheme
+ uri_parts = urlparse(uri)
+ hostname = uri_parts.hostname or ''
+ conn_type = uri_parts.scheme
if conn_type == 'postgresql':
conn_type = 'postgres'
+ elif '-' in conn_type:
+ conn_type = conn_type.replace('-', '_')
Review comment:
OK. Make sense! I agree it's the best way of solving it this way. Good
analysis and solution !
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services