Vishwaspatel2401 opened a new pull request, #69766:
URL: https://github.com/apache/airflow/pull/69766
## Description
`BaseSerialization` was adding an extra list/tuple layer around the `args`
of built-in exceptions such as `KeyError` and `AttributeError` during
serialization.
```python
"args": [var.args]
```
Because `var.args` is already a tuple, an exception such as
`KeyError("boom")` was serialized incorrectly:
```python
from airflow.serialization.serialized_objects import BaseSerialization
result = BaseSerialization.deserialize(
BaseSerialization.serialize(KeyError("boom"))
)
result.args # (("boom",),) instead of ("boom",)
```
This change preserves the exception’s original `args` exactly during
serialization and deserialization.
Closes #69743.
## Tests
Added parametrized test cases to `test_serialize_deserialize` in
`test_serialized_objects.py` covering:
* `KeyError("boom")`
* `AttributeError("boom")`
* `KeyError("a", "b")`
The tests verify that `.args` is preserved exactly after serialization and
deserialization. All 40 parametrized test cases pass.
---
##### Was generative AI tooling used to co-author this PR?
* [x] Yes
Generated-by: Claude Code, used in accordance with the project’s
contribution guidelines.
--
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]