-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Import connections from a file #15177
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
|
85b5c7f
to
5a09934
Compare
When a connections file contains collisions with existing connections, skip them and print a message to stdout indicating that the connection was not imported.
Awesome work, congrats on your first merged pull request! |
Congrats @natanweinberger ! |
Sorry, @natanweinberger , it must be wrong place to ask such question, but I tried this feature and get following error:
Am I doing something completly wrong? |
Hey @mudravrik, I see the issue. Thanks for the heads up, I will fix this and open a new PR shortly. |
How did this not get a documentation entry? Any definition of how the json must look like? Even the sample.json mentioned in the tests is not in this PR, is it? |
If you really cared to ask this kind of question @MM-Lehmann, then I believe because apparently you wanted to hear the answer rather than show your superiority over those who volunteer their time so that you can get great FREE software. So here it is. My one answer is - because people are humans and when they try to improve something, they sometimes make mistakes (as opposed to people who do not do do much so they do not do mistakes either). Or maybe another answer - because you weren't around with helpful comment like that when it was discussed @MM-Lehmann . I am sure if you were around such mistakes would not have happened. Please next time be sure to follow up the changed PRs and catch such omissions early. Airflow PRs can be commented and suggested by everyone. Please do so next time before merging! You are most welcome. |
'And answering your other question @MM-Lehmann - in case you have not noticed the "import" command is counterpart of the "export" command https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#export which result you can inspect and check the format. If you really think the format needs to be described - you are absolutely invited to contribute documentation for both export and import after reverse engineering it! I am not kidding. I think this might be valuable contribution and great way to repay for all the countless - often unpaid hours other contributors spent on building airflow (which you can now use for free). |
Hi @natanweinberger , can we have a |
Good idea @ishnmu, I just opened a PR that adds this functionality. |
This PR adds the ability to import connections from a file.
This implementation enables basic import functionality, mirroring what already exists for variables. There's room for additional features in future (as proposed in #9907 discussion), but I believe it's reasonable to add those extra features as incremental improvements in a future PR. For example:
Currently, in the event of a conflict, the connection to be imported is skipped and a message is printed to stdout indicating to the user that there's a conflict. Any connections without conflicts are still imported.
closes: #9855