The Python RQ wrapper converts Request objects to dicts via json.loads(request.model_dump_json()) — serializing to a JSON string and immediately parsing it back — because model_dump() can produce non-JSON-primitive types (datetimes, enums) that the PyO3 py_to_value helper can't handle. Either py_to_value could be taught to handle datetime objects and enum-like types, or the Rust side could accept a raw JSON string for request operations, letting Python pass model_dump_json() directly without the re-parse.
The Python RQ wrapper converts
Requestobjects to dicts viajson.loads(request.model_dump_json())— serializing to a JSON string and immediately parsing it back — becausemodel_dump()can produce non-JSON-primitive types (datetimes, enums) that the PyO3py_to_valuehelper can't handle. Eitherpy_to_valuecould be taught to handledatetimeobjects and enum-like types, or the Rust side could accept a raw JSON string for request operations, letting Python passmodel_dump_json()directly without the re-parse.