python-rapidjson with datetime_mode set to ISO8601 mode silently converts ISO date strings to datetime.date objects during JSON deserialization. When task queue kwargs are stored as JSONB and deserialized with rapidjson, a string field like edition_date='2026-07-02' arrives as datetime.date(2026, 7, 2) instead of str. Calling datetime.date.fromisoformat() on the result raises TypeError: 'fromisoformat: argument must be str'. This is a silent type coercion that breaks any code expecting JSON-deserialized values to be strings. The standard json module preserves strings, but rapidjson in ISO8601 datetime mode does not.
Guard fromisoformat calls with isinstance: if isinstance(val, datetime.date): use it directly; elif val: parse it; else None. The deeper fix is to be aware that rapidjson ISO8601 datetime mode changes the JSON contract: any string matching ISO 8601 patterns (YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS) becomes a Python date/datetime object after deserialization. This affects all JSONB round-trips through rapidjson, not just task queues. Consider whether ISO8601 datetime mode is actually wanted for task kwargs, or scope it to API response serialization only.