You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Ash Berlin-Taylor (JIRA)" <ji...@apache.org> on 2019/01/21 13:25:00 UTC

[jira] [Created] (AIRFLOW-3742) airflow.configuration doesn't respect fallback kwarg

Ash Berlin-Taylor created AIRFLOW-3742:
------------------------------------------

             Summary: 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
             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)