You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Reginald A Gomez (Jira)" <ji...@apache.org> on 2020/02/06 20:10:00 UTC
[jira] [Updated] (AIRFLOW-6749) Inconsistent types in
connection.extra_dejson when using a URI vs a Json String
[ https://issues.apache.org/jira/browse/AIRFLOW-6749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reginald A Gomez updated AIRFLOW-6749:
--------------------------------------
Description:
When a Connection object is created from a URI, the deserialized extra fields, extra_dejson, can only be strings. When a Connection object is created from a serialized json string in the Airflow DB, fields can be deseriazlied into booleans and ints fine.
Understand that this is a limitation in datatypes that can be encoded in a URI string. Wonder though if we can create some extra getters to automatically handle type conversion. Similar to configuration getters that currently exists. configuration.getint() for example
Set extra in UI as:
'\{"tls": true}'
decodes to
{"tls": true}
vs URI
'?tls=True'
decodes to
{"tls": "True"}
was:
When a Connection object is created from a URI, the deserialized extra fields, extra_dejson, can only be strings. When a Connection object is created from a serialized json string in the Airflow DB, fields can be deseriazlied into booleans and ints fine.
Understand that this is a limitation in datatypes that can be encoded in a URI string. Wonder though if we can create some extra getters to automatically handle type conversion. Similar to configuration getters that currently exists. configuration.getint() for example
Set extra in UI as:
{"tls": true}
decodes to
{"tls": true}
vs URI
?tls=True
decodes to
{"tls": "True"}
> Inconsistent types in connection.extra_dejson when using a URI vs a Json String
> -------------------------------------------------------------------------------
>
> Key: AIRFLOW-6749
> URL: https://issues.apache.org/jira/browse/AIRFLOW-6749
> Project: Apache Airflow
> Issue Type: Bug
> Components: models
> Affects Versions: 1.10.7
> Reporter: Reginald A Gomez
> Priority: Minor
>
> When a Connection object is created from a URI, the deserialized extra fields, extra_dejson, can only be strings. When a Connection object is created from a serialized json string in the Airflow DB, fields can be deseriazlied into booleans and ints fine.
>
> Understand that this is a limitation in datatypes that can be encoded in a URI string. Wonder though if we can create some extra getters to automatically handle type conversion. Similar to configuration getters that currently exists. configuration.getint() for example
>
> Set extra in UI as:
> '\{"tls": true}'
> decodes to
> {"tls": true}
>
> vs URI
> '?tls=True'
> decodes to
> {"tls": "True"}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)