[
https://issues.apache.org/jira/browse/AIRFLOW-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16057929#comment-16057929
]
Yu Ishikawa commented on AIRFLOW-1330:
--------------------------------------
I think we need to change the command line options for a command to add
connection on our CLI. Because the command requires connection URI whose parser
is implemented on {{urllib.parse.urlparse}}. As I mentioned above, however, the
specification of URL by RFC doesn't allow include under score(s). So we have
two approaches to improve the command to add a connection.
1. Have a kind of dictionary between a connection type and its alias. For
example, when we want to add a connection for google cloud platform, we could
define one like {{'google+cloud+platform' -> 'google_cloud_platform'}}.
2. Change the command line options to add a connection to specify a connection
type without a connection URI like bellow.
{noformat}
airflow connections --add --conn_id google_cloud_default --conn_type
google_cloud_platform ...
{noformat}
The first option could be a little hacky, because we have to add new mapping if
the connection type includes under scores. So, the later option would work.
> Connection.parse_from_uri doesn't work for google_cloud_platform and so on
> --------------------------------------------------------------------------
>
> Key: AIRFLOW-1330
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1330
> Project: Apache Airflow
> Issue Type: Bug
> Components: cli
> Reporter: Yu Ishikawa
>
> h2. Overview
> {{Connection.parse_from_uri}} doesn't work for some types like
> {{google_cloud_platform}} whose type name includes under scores. Since
> `urllib.parse.urlparse()` which is used in {{Connection.parse_from_url}}
> doesn't support a schema name which include under scores.
> So, airflow's CLI doesn't work when a given connection URI includes under
> scores like {{google_cloud_platform://XXXXX}}.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)