[ 
https://issues.apache.org/jira/browse/AIRFLOW-3742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16748092#comment-16748092
 ] 

ASF subversion and git services commented on AIRFLOW-3742:
----------------------------------------------------------

Commit 983dca2e326b7246f8b063ff3de8f559185c18d9 in airflow's branch 
refs/heads/config-parser-fallback-get from Ash Berlin-Taylor
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=983dca2 ]

[AIRFLOW-3742] Respect the `fallback` arg in airflow.configuration.get

This argument is part of the API from our parent class, but we didn't
support it because of the various steps we perform in `get()` - this
makes it behave more like the parent class, and can simplify a few
instances in our code (I've only included one that I found here)


> airflow.configuration doesn't respect fallback kwarg
> ----------------------------------------------------
>
>                 Key: AIRFLOW-3742
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3742
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: configuration
>            Reporter: Ash Berlin-Taylor
>            Assignee: Ash Berlin-Taylor
>            Priority: Minor
>             Fix For: 1.10.3
>
>
> The ConfigParser class we base our config parser on can optionally accept a 
> fallback argument:
> {code:python}
> conf.get('sect', 'key', fallback='default')
> {code}
> but our sub-class doesn't support this. It would be nice if we did. Then we 
> can turn
> {code:python}
> plugins_folder = configuration.conf.get('core', 'plugins_folder')
> if not plugins_folder:
>     plugins_folder = settings.AIRFLOW_HOME + '/plugins'
> {code}
> in to this:
> {code:python}
> plugins_folder = configuration.conf.get('core', 'plugins_folder', 
> fallback=settings.AIRFLOW_HOME + '/plugins')
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to