[
https://issues.apache.org/jira/browse/AIRFLOW-2666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16651750#comment-16651750
]
jack commented on AIRFLOW-2666:
-------------------------------
I had no trouble importing float numbers.
I did have a problem importing integers.
Reproduce steps:
Created 3 variables:
key: z value: 7
key: z1 value: 4.5
key zz value: hello
exported to file.
File looks like:
{
"z": 7,
"z1": 4.5,
"zz": "hello"
}
Deleted the vars and imported from the file.
What I see on UI is:
Key: z value: empty (empty string)
Key: z1 value: 4.5
key: zz value: hello
> Cannot import exported variables
> --------------------------------
>
> Key: AIRFLOW-2666
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2666
> Project: Apache Airflow
> Issue Type: Bug
> Components: cli
> Affects Versions: 1.9.0
> Reporter: Emmanuel Brard
> Priority: Major
>
> When exporting variables, it looks like the export helper serialize to JSON
> with JSON type, so an float is a float in the resulting file.
>
> But then when importing from this file, there is no type convertion and this
> step in the set_val method (class Variable) fails:
>
> self._val = fernet.encrypt(bytes(value, 'utf-8')).decode()
>
> With "encoding without a string argument"
>
> A simple fix would be to:
>
> self._val = fernet.encrypt(bytes(str(value), 'utf-8')).decode()
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)