Handle json encoding of V1Pod in task callback#27609
Conversation
0d48933 to
bd0521c
Compare
bd0521c to
e18366b
Compare
|
Why don't we use |
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
35839ea to
1598796
Compare
Seemed like a good idea so I explored it just now. The problem is that AirflowJsonEncoder is only one way -- there's no AirflowJsonDecoder that will get you back the same object. For example, when encoding a pod, it doesn't store anywhere the information that the json came from a v1pod so when decoding the json you would just get back dict of plain json-compatible objects. So, we cannot use this approach. HOWEVER... with some adjustments, we can use BaseSerialization. Not sure if this is any better but, i've taken a crack at it. @uranusjr what do you think is better? Currently PR is converting to use BaseSerialization. The original approach remains visible at https://github.com/apache/airflow/compare/main..15987961421ea5aa3c05b429c068cec85c55b774 |
| return NotImplemented | ||
|
|
||
| def as_dict(self): | ||
| warnings.warn("This method is deprecated. Use BaseSerialization.serialize.", DeprecationWarning) |
There was a problem hiding this comment.
Probably should have stacklevel=2 to make the warning show the previous stack?
Resolves #27593