airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ashb commented on a change in pull request #4030: [AIRFLOW-XXX] Log the task_id in the PendingDeprecationWarning for BaseOperator
Date Wed, 10 Oct 2018 15:09:11 GMT
ashb commented on a change in pull request #4030: [AIRFLOW-XXX] Log the task_id in the PendingDeprecationWarning
for BaseOperator
URL: https://github.com/apache/incubator-airflow/pull/4030#discussion_r224119080
 
 

 ##########
 File path: airflow/models.py
 ##########
 @@ -2494,11 +2494,11 @@ def __init__(
         if args or kwargs:
             # TODO remove *args and **kwargs in Airflow 2.0
             warnings.warn(
-                'Invalid arguments were passed to {c}. Support for '
-                'passing such arguments will be dropped in Airflow 2.0. '
-                'Invalid arguments were:'
+                'Invalid arguments were passed to {c} (task_id: {t}). '
+                'Support for passing such arguments will be dropped in '
+                'Airflow 2.0. Invalid arguments were:'
                 '\n*args: {a}\n**kwargs: {k}'.format(
-                    c=self.__class__.__name__, a=args, k=kwargs),
+                    c=self.__class__.__name__, a=args, k=kwargs, t=task_id),
                 category=PendingDeprecationWarning
 
 Review comment:
   Logging the task id sounds helpful, but if we add a parameter of `stacklevel=3` (I think
3 is the right value) then this will also include the filename and line number of the call.
Could you add this in too?
   
   (1 is this location, 2 is the constructor of the Operator itself, and 3 should be the line
in the dag)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message