Changes between Initial Version and Version 1 of Ticket #35381, comment 18
- Timestamp:
- Aug 25, 2025, 5:26:09 AM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35381, comment 18
initial v1 1 1 I’d like clarification on whether we also want to deprecate `filter(data__key=None)`. 2 2 3 As I understand it, the ambiguity motivating deprecation at the top level does not exist inside a JSON document. A key’s value can be JSON `null`, but it cannot be SQL `NULL`. For that reason, I think filter(data__key=None)should continue to match JSON `null`.3 As I understand it, the ambiguity motivating deprecation at the top level does not exist inside a JSON document. A key’s value can be JSON `null`, but it cannot be SQL `NULL`. For that reason, I think `.filter(data__key=None)` should continue to match JSON `null`. 4 4 5 5 We could still allow `.filter(data__key=JSONNull())` for users who want explicitness, without deprecating `None` usage in this case, especially as Jacob pointed out, this case is more common. Additionally, on the creation side, supporting nested JSON null like {"key": JSONNull()} in inserts/updates would require a custom encoder, which isn’t the case for `JSONNull()` at the top level. Since users can already override encoders/decoders, we can’t make that work universally. We could bypass this problem by introducing and promoting (in the docs) the use of `__is_jsonnull` lookup for querying and JSONNull() for creating top-level JSON `null`.