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 2021/12/16 22:19:05 UTC

[GitHub] [airflow] ashb commented on a change in pull request #20322: Un-ignore DeprecationWarning

ashb commented on a change in pull request #20322:
URL: https://github.com/apache/airflow/pull/20322#discussion_r770958858



##########
File path: airflow/utils/context.py
##########
@@ -191,7 +191,14 @@ def items(self):
     def values(self):
         return ValuesView(self._context)
 
-    def copy_only(self, keys: Container[str]) -> "Context":
-        new = type(self)({k: v for k, v in self._context.items() if k in keys})
-        new._deprecation_replacements = self._deprecation_replacements.copy()
-        return new
+
+def context_copy_partial(source: Context, keys: Container[str]) -> "Context":
+    """Create a context by copying items under selected keys in ``source``.
+
+    This is implemented as a free function because the ``Context`` type is
+    "faked" as a ``TypedDict`` in ``context.pyi``, which cannot have custom
+    functions.

Review comment:
       ```suggestion
       functions.
       
       :meta private:
   ```
   
   as we probably don't want this to be part of the "public API".




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org