thoniTUB opened a new issue, #61490:
URL: https://github.com/apache/airflow/issues/61490

   ### Apache Airflow version
   
   3.1.7
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I strumbled on this inconsistency:
   #### Not Working: Create Variable with CLI Import
   I cannot import this variable from a file using the cli command `airflow 
variables import variables.json`:
   ```yaml
   # variables.json
   {
       "var1": [
           {
               "foo": "bar"
           },
           {
               "bar": "foo"
           }
       ]
   }
   ```
   It fails with the message:
   > The "variables.json" file contains multiple values for keys: ['var1']
   
   #### Working: Create Variable using the UI
   I can however create this variable in the UI.  
   Then I can use `airflow variables export variables.json` to dump the very 
same JSON as above, which cannot be imported again.
   
   
   
   ### What you think should happen instead?
   
   [The code 
here](https://github.com/apache/airflow/blob/8f3ae04f89e4679c02b4a2500557cf46863af854/airflow-core/src/airflow/secrets/local_filesystem.py#L247)
 blocks this import of a list value with more than 1 item.  
   However, it does not explain why a list with multiple elements is not 
allowed here.
   
   ### How to reproduce
   
   Start a airflow instance and do the steps described above.
   
   ### Operating System
   
   RHEL 9
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   poetry managed env and a `airflow standalone` instance
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to