New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ airflow connections import
fails with AttributeError
#15931
Comments
airflow connections import foo.json
fails with AttributeError
$ airflow connections import foo.json
fails with AttributeError
$ airflow connections import foo.json
fails with AttributeError
$ airflow connections import
fails with AttributeError
I was not able to reproduce this. Can you check the content inside the connections.json? I'm suspecting that it has errors. This worked for me: echo '{"sqlite_conn_id": {
"conn_type": "sqlite",
"description": "",
"host": "localhost",
"login": "",
"password": null,
"schema": "/usr/local/airflow/test.db",
"port": null,
"extra": ""
}}' > connections.json
airflow connections import connections.json
|
Hmm, maybe there's something different about our environments. I can indeed replicate it with that json. To protect against environmental differences, here's a session that does it in docker:
And an asciicast: https://asciinema.org/a/86Y40kiOwPXcF4jKw3n59FA3Z?theme=solarized-dark&speed=1.5 (I used @ephraimbuddy Do you get something different when you run it in docker like that? |
This was a duplicate of #15425 It's fixed now. |
Apache Airflow version
6f8c204
Environment
OS (e.g. from /etc/os-release): Mac OS 11.3
Kernel: Darwin Kernel Version 20.4.0
Install tools: pip install -e .
What happened:
Tried to import valid connection json via the cli. Got an error:
Several of the tests assume that
load_connections_dict
returns a dict of dictsairflow/tests/cli/commands/test_connection_command.py
Line 790 in 6f8c204
Actually,
load_connections_dict
returns a dict ofConnection
sairflow/airflow/secrets/local_filesystem.py
Line 278 in 6f8c204
When we call
.items()
on theConnection
, it fails.What you expected to happen:
The import is sucessful.
How to reproduce it:
See commands above.
Anything else we need to know:
This commit fixes it (I think): MatrixManAtYrService@5159059
I started making a PR, but while trying to make the tests pass I started to worry that I was on the wrong path, so I made an issue instead.
The text was updated successfully, but these errors were encountered: