rusackas commented on code in PR #45761:
URL: https://github.com/apache/superset/pull/45761#discussion_r4395561604
##########
superset/key_value/types.py:
##########
@@ -29,6 +28,7 @@
KeyValueCodecDecodeException,
KeyValueCodecEncodeException,
)
+from superset.utils import json
Review Comment:
Good catch. `decode` now passes `allow_nan=True`, so legacy `NaN`/`Infinity`
payloads still load. Added a test.
##########
superset/key_value/types.py:
##########
@@ -115,6 +115,9 @@ def decode(self, value: bytes) -> Any: ...
class JsonKeyValueCodec(KeyValueCodec):
def encode(self, value: dict[Any, Any]) -> bytes:
+ # JSON has no binary type; raw bytes must not be silently stringified
+ if isinstance(value, (bytes, bytearray)):
Review Comment:
Not intended. `encode` now walks the value and raises
`KeyValueCodecEncodeException` on bytes nested in dicts/lists, with a test.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]