diff --git a/CHANGELOG.md b/CHANGELOG.md index 25aabc7812..8720e3399f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Copy and pasting the git commit messages is __NOT__ enough. ### Fixed - Fixed issue where `SumoTrafficSimulation` could get locked up on reset if a scenario had only 1 map but multiple scenario variations. - Fixed an issue where an out-of-scope method reference caused a pickling error. +- Fixed an issue where the `EnvisionDataFormatterArgs` default would use a locally defined lambda and cause a serialization failure. ### Removed ### Security diff --git a/envision/data_formatter.py b/envision/data_formatter.py index 1a0dae4e36..3e8a124bac 100644 --- a/envision/data_formatter.py +++ b/envision/data_formatter.py @@ -75,6 +75,10 @@ class Operation(IntEnum): _primitives = {int, float, str, VehicleType, TrafficActorType} +def _passthrough_method_1_arg(v): + return v + + class ReductionContext: """Mappings between an object and its reduction to an ID.""" @@ -126,7 +130,7 @@ class EnvisionDataFormatterArgs(NamedTuple): """Data formatter configurations.""" id: Optional[str] - serializer: Callable[[list], Any] = lambda d: d + serializer: Callable[[list], Any] = _passthrough_method_1_arg float_decimals: int = 2 bool_as_int: bool = True enable_reduction: bool = True