airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maik Wild (Jira)" <j...@apache.org>
Subject [jira] [Updated] (AIRFLOW-6237) apply_defaults decorator breaks inspect.getfullargspec
Date Thu, 12 Dec 2019 15:10:00 GMT

     [ https://issues.apache.org/jira/browse/AIRFLOW-6237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Maik Wild updated AIRFLOW-6237:
-------------------------------
    Description: 
[inspect.getfullargspec|https://docs.python.org/3/library/inspect.html#inspect.getfullargspec]
will not return any arguments when using the decorator [apply_defaults|https://github.com/apache/airflow/blob/master/airflow/utils/decorators.py#L31].
When I remove the decorator getfullargspec works as expected.

{code:python}
>>> import inspect
>>> from airflow.operators.dagrun_operator import TriggerDagRunOperator

>>> inspect.getfullargspec(TriggerDagRunOperator)
FullArgSpec(args=[], varargs='args', varkw='kwargs', defaults=None, kwonlyargs=[], kwonlydefaults=None,
annotations={})
>>> inspect.signature(TriggerDagRunOperator)

<Signature (trigger_dag_id, python_callable=None, execution_date=None, *args, **kwargs)>
{code}

When i remove the decorator from __init__:


{code:python}
>>> import inspect
>>> from airflow.operators.dagrun_operator import TriggerDagRunOperator

>>> inspect.getfullargspec(TriggerDagRunOperator)
FullArgSpec(args=['self', 'trigger_dag_id', 'python_callable', 'execution_date'], varargs='args',
varkw='kwargs', defaults=(None, None), kwonlyargs=[], kwonlydefaults=None, annotations={})

>>> inspect.signature(TriggerDagRunOperator)
<Signature (trigger_dag_id, python_callable=None, execution_date=None, *args, **kwargs)>
{code}


  was:
When using the [apply_defaults|https://github.com/apache/airflow/blob/master/airflow/utils/decorators.py#L31]
[inspect.getfullargspec|https://docs.python.org/3/library/inspect.html#inspect.getfullargspec]
will not return any arguments . When I remove the decorator getfullargspec works as expected.

{code:python}
>>> import inspect
>>> from airflow.operators.dagrun_operator import TriggerDagRunOperator

>>> inspect.getfullargspec(TriggerDagRunOperator)
FullArgSpec(args=[], varargs='args', varkw='kwargs', defaults=None, kwonlyargs=[], kwonlydefaults=None,
annotations={})
>>> inspect.signature(TriggerDagRunOperator)

<Signature (trigger_dag_id, python_callable=None, execution_date=None, *args, **kwargs)>
{code}

When i remove the decorator from __init__:


{code:python}
>>> import inspect
>>> from airflow.operators.dagrun_operator import TriggerDagRunOperator

>>> inspect.getfullargspec(TriggerDagRunOperator)
FullArgSpec(args=['self', 'trigger_dag_id', 'python_callable', 'execution_date'], varargs='args',
varkw='kwargs', defaults=(None, None), kwonlyargs=[], kwonlydefaults=None, annotations={})

>>> inspect.signature(TriggerDagRunOperator)
<Signature (trigger_dag_id, python_callable=None, execution_date=None, *args, **kwargs)>
{code}



> apply_defaults decorator breaks inspect.getfullargspec
> ------------------------------------------------------
>
>                 Key: AIRFLOW-6237
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6237
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: operators, utils
>    Affects Versions: 1.10.4
>         Environment: Python 3.6.6 
> Debian_9
>            Reporter: Maik Wild
>            Priority: Minor
>
> [inspect.getfullargspec|https://docs.python.org/3/library/inspect.html#inspect.getfullargspec]
will not return any arguments when using the decorator [apply_defaults|https://github.com/apache/airflow/blob/master/airflow/utils/decorators.py#L31].
When I remove the decorator getfullargspec works as expected.
> {code:python}
> >>> import inspect
> >>> from airflow.operators.dagrun_operator import TriggerDagRunOperator
> >>> inspect.getfullargspec(TriggerDagRunOperator)
> FullArgSpec(args=[], varargs='args', varkw='kwargs', defaults=None, kwonlyargs=[], kwonlydefaults=None,
annotations={})
> >>> inspect.signature(TriggerDagRunOperator)
> <Signature (trigger_dag_id, python_callable=None, execution_date=None, *args, **kwargs)>
> {code}
> When i remove the decorator from __init__:
> {code:python}
> >>> import inspect
> >>> from airflow.operators.dagrun_operator import TriggerDagRunOperator
> >>> inspect.getfullargspec(TriggerDagRunOperator)
> FullArgSpec(args=['self', 'trigger_dag_id', 'python_callable', 'execution_date'], varargs='args',
varkw='kwargs', defaults=(None, None), kwonlyargs=[], kwonlydefaults=None, annotations={})
> >>> inspect.signature(TriggerDagRunOperator)
> <Signature (trigger_dag_id, python_callable=None, execution_date=None, *args, **kwargs)>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message