uranusjr commented on code in PR #26191:
URL: https://github.com/apache/airflow/pull/26191#discussion_r964457297
##########
airflow/utils/sqlalchemy.py:
##########
@@ -166,9 +166,10 @@ def bind_processor(self, dialect):
super_process = super().bind_processor(dialect)
def process(value):
- if isinstance(value, dict) and 'pod_override' in value:
- value['pod_override'] =
BaseSerialization()._serialize(value['pod_override'])
- return super_process(value)
+ val_copy = copy.copy(value)
+ if isinstance(val_copy, dict) and 'pod_override' in val_copy:
+ val_copy['pod_override'] =
BaseSerialization._serialize(val_copy['pod_override'])
Review Comment:
I’m thinking line 170 should be
```python
if not is_serialized(val_copy):
```
with the function implemented as
```python
def is_serialized(v):
if not isinstance(v, dict):
return False
return Encoding.TYPE in v and Encoding.VAR in v
```
This can be used to unify the logic on line 187/188.
--
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]