potiuk commented on code in PR #25780:
URL: https://github.com/apache/airflow/pull/25780#discussion_r948873289


##########
airflow/operators/python.py:
##########
@@ -176,7 +178,7 @@ def execute(self, context: Context) -> Any:
 
         return return_value
 
-    def determine_kwargs(self, context: Mapping[str, Any]) -> Mapping[str, 
Any]:
+    def determine_kwargs(self, context: MutableMapping[str, Any]) -> 
MutableMapping[str, Any]:

Review Comment:
   No. Actually the problem is that previously mypy has not detected the 
modifications we've done to op_kwargs.
   
   ```
           if self.templates_dict:
               op_kwargs['templates_dict'] = self.templates_dict
   ```
   
   is not possible for Mapping (Mapping is immutable). Seems it "accidentally" 
worked because our Mapping was really a Dict. But the right solution is to 
create a new mapping out of it.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to