mik-laj commented on a change in pull request #6426: [AIRFLOW-5751] add get_uri method to Connection URL: https://github.com/apache/airflow/pull/6426#discussion_r338931333
########## File path: airflow/models/connection.py ########## @@ -145,6 +145,38 @@ def parse_from_uri(self, uri): if uri_parts.query: self.extra = json.dumps(dict(parse_qsl(uri_parts.query, keep_blank_values=True))) + def get_uri(self) -> str: + uri = '{}://'.format(self.conn_type.replace('_', '-')) + + user_block = '' + if self.login is not None: + user_block += quote(self.login, safe='') + + if self.password is not None: + user_block += ':' + quote(self.password) + + if user_block > '': + user_block += '@' Review comment: ```suggestion authority_block += '@' ``` In this block you store username and password, so this name will be better and it is compliant with RFC. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services