You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/16 19:21:52 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #11597: Raises a warning for provide_context instead of killing the task

kaxil commented on a change in pull request #11597:
URL: https://github.com/apache/airflow/pull/11597#discussion_r506677382



##########
File path: airflow/operators/python.py
##########
@@ -85,6 +86,9 @@ def __init__(
         templates_exts: Optional[List[str]] = None,
         **kwargs
     ) -> None:
+        if kwargs.get("provide_context"):
+            warnings.warn("provide_context is deprecated as of 2.0 and is no longer required")
+            kwargs.pop('provide_context', None)

Review comment:
       ```suggestion
           if kwargs.get("provide_context"):
               warnings.warn("provide_context is deprecated as of 2.0 and is no longer required", DeprecationWarning, stacklevel=2)
               kwargs.pop('provide_context', None)
   ```
   
   This should take care of @ashb 's suggestion




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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