-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Control permissibility of driver config in extra from airflow.cfg #31754
Control permissibility of driver config in extra from airflow.cfg #31754
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Though. Yeah @uranusjr was right that likely __
instead of _
is better.
if you guys both feel that way after the following argument then i'll change it
|
I think two is more consistent with the idea behind. We don't really replace the character, we account for the fact that our config has no hierarchy of configurations. So one could argue that
And then But it has hit people back in the past even for regular sections. That's why in https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#elasticsearch-configs the env variables are explicitly spelled exactly as they should be, This is the "discoverabilty" that we are missing currently that I mentioned in the slack thread. And since then I can't recall single issue with using I think if we care for users not making mistakes we should be very precise and add examples in the docs that they will be able to copy&paste - both for config and variable. And once we do it, decision whether to use (BTW. That does recall some of the discussions we had years ago when we wanted to add google provider specific config). |
I can see arguments for both |
d0eedf8
to
444077d
Compare
yeah apparently some github issue
nice so that makes two of us -- we're a deadlock now if we can just cajole @ephraimbuddy to our side ... |
added a note in core |
I am actually not super strong on that one (once the example is there - it does not matter). If anyone feels strong - go for whatever option you choose. |
Note that when the section name has a dot in it, you must replace it with an underscore when setting the env var. | ||
For example consider section ``providers.odbc``: | ||
|
||
.. code-block:: ini | ||
|
||
[providers.odbc] | ||
allow_driver_in_extra = true | ||
|
||
.. code-block:: bash | ||
|
||
export AIRFLOW__PROVIDERS_ODBC__ALLOW_DRIVER_IN_EXTRA=true | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not sure if we should have providers settings in Airflow core docs..
this may create issues if for some reason in future the provider will remove this.
This also goes against our goal of eventually extracting the provider code base out of airflow core (at least I think we want to be ready for a day where we might want to do it)
If we must do this I think it's preferred to add a note with a link to the relevant information in the provider docs (external link!) thus treating the providers doc as external resource like any other package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... this is meant to be an example. If you like i can make it not refer to specific case. i thought about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok have a look please @eladkal
I removed the hook param
driver_in_extra
i figured having it only in airflow settings was good enough but lemme know if you think we need both.