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 2020/05/29 08:24:07 UTC

[GitHub] [airflow] frnidito opened a new issue #9060: Connection support for repeated extra fields

frnidito opened a new issue #9060:
URL: https://github.com/apache/airflow/issues/9060


   **Description**
   
   The `Connection` object should be able to support repeated keys in the extra fields.
   
   **Use case / motivation**
   
   Some connections strings, for instance the one used by MongoDB, support the repetition of keys such as in setting the rules for the precedence in choosing data-centres:
   
   `mongodb://mongos1.example.com,mongos2.example.com/?readPreference=secondary&readPreferenceTags=dc:ny,rack:r1&readPreferenceTags=dc:ny&readPreferenceTags=`
   
   At the moment, there is no way to set this in the Connection neither though the UI nor using the CLI.
   ```
   >>> from airflow.models.connection import Connection
   >>> c = Connection(uri='my-conn-type://my-login:my-password@my-host:5432/my-schema?param1=val1&param2=val2')
   >>> c.extra
   '{"param1": "val1", "param2": "val2"}'
   >>> c.set_extra('{"param1": "val1", "param1": "val2"}')  # <- here
   >>> c.get_uri()
   'my-conn-type://my-login:my-password@my-host:5432/my-schema?param1=val2'
   ```
   
   Adding support to this, maybe with an array form in the JSON would be ideal, i.e., being able to write something like:
   ```
   >>> c.set_extra('{"param1": ["val1", "val2"]}')
   >>> c.get_uri()
   'my-conn-type://my-login:my-password@my-host:5432/my-schema?param1=val1&param1=val2'
   ```


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



[GitHub] [airflow] github-actions[bot] commented on issue #9060: Connection support for repeated extra fields

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #9060:
URL: https://github.com/apache/airflow/issues/9060#issuecomment-864478656


   This issue has been automatically marked as stale because it has been open for 30 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.


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



[GitHub] [airflow] github-actions[bot] commented on issue #9060: Connection support for repeated extra fields

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #9060:
URL: https://github.com/apache/airflow/issues/9060#issuecomment-869246029


   This issue has been closed because it has not received response from the issue author.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #9060: Connection support for repeated extra fields

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #9060:
URL: https://github.com/apache/airflow/issues/9060#issuecomment-635843013


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


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



[GitHub] [airflow] dstandish commented on issue #9060: Connection support for repeated extra fields

Posted by GitBox <gi...@apache.org>.
dstandish commented on issue #9060:
URL: https://github.com/apache/airflow/issues/9060#issuecomment-820079748


   @frnidito we now can serialize full json to the conn URI (see https://github.com/apache/airflow/pull/15100)
   
   is it ok to close this issue?


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



[GitHub] [airflow] github-actions[bot] closed issue #9060: Connection support for repeated extra fields

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #9060:
URL: https://github.com/apache/airflow/issues/9060


   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on issue #9060: Connection support for repeated extra fields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #9060:
URL: https://github.com/apache/airflow/issues/9060#issuecomment-636518696


   https://github.com/apache/airflow/blob/ffbbbfc1a7c2266a19293e0c06b80d46e394fe57/airflow/models/connection.py#L211
   If we want arrays to be created via the URL, we need to improve the parsing of the query string. Currently, you can only define a string there.


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