You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/05/30 13:16:00 UTC

[jira] [Commented] (AIRFLOW-3869) raise consistent Exception in AirflowConfigParser.getboolean

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

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

Commit f1f9d7b3713fe1dfd1bb8def51b3c5960c550c15 in airflow's branch refs/heads/v1-10-test from Tanay Tummalapalli
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=f1f9d7b ]

[AIRFLOW-3869] Raise consistent exception in AirflowConfigParser.getboolean (#4692)

AirflowConfigParser.getboolean raises an AirflowConfigException
when the value of a configuration cannot be converted to boolean.
But, getint and getfloat raise a ValueError in the same case when
the value cannot be casted to the desired type.
They should raise the same exception - ValueError.

Also, added tests for getboolean, getint and getfloat.

(cherry picked from commit db91909b57de9279b53d99e9c9110ed6925b0c4c)


> raise consistent Exception in AirflowConfigParser.getboolean
> ------------------------------------------------------------
>
>                 Key: AIRFLOW-3869
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3869
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: configuration
>    Affects Versions: 1.10.2
>            Reporter: Tanay Tummalapalli
>            Assignee: Tanay Tummalapalli
>            Priority: Trivial
>             Fix For: 2.0.0
>
>
> The getboolean method of AirflowConfigParser class raises AirflowConfigException when the value of the configuration cannot be casted to bool. But, getint and getfloat raise ValueError in the same case. 
> So, when getboolean cannot cast the value of the config to bool, it should raise ValueError.
> Also, add tests for the same.
> Reference:
> 1. [https://github.com/apache/airflow/blob/master/airflow/configuration.py#L272]
> 2. https://issues.apache.org/jira/browse/AIRFLOW-3742



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