uranusjr commented on a change in pull request #20361:
URL: https://github.com/apache/airflow/pull/20361#discussion_r778554258



##########
File path: airflow/utils/operator_helpers.py
##########
@@ -77,6 +87,21 @@ def context_to_airflow_vars(context: Mapping[str, Any], 
in_env_var_format: bool
         (dag_run, 'run_id', 'AIRFLOW_CONTEXT_DAG_RUN_ID'),
     ]
 
+    context_params = settings.get_airflow_context_vars(context)
+    for key, value in context_params.items():
+        if not isinstance(key, str):
+            raise TypeError("key must be string")
+        if not isinstance(value, str):
+            raise TypeError("value must be string")

Review comment:
       Can we show the value of `key` and `value` in the exception message? 
This would help the user debug the problem. Something like `f"key must be 
string, not {key!r}"` would be enough (and the value variant should show both 
`key` and `value`).




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