rusackas commented on code in PR #45761:
URL: https://github.com/apache/superset/pull/45761#discussion_r4407850663


##########
tests/unit_tests/key_value/codec_test.py:
##########
@@ -134,3 +148,33 @@ def test_binary_codec_round_trips():
     raw = b"\x00\x01binary\xffdata"
     assert codec.decode(raw) == raw
     assert codec.encode(codec.decode(raw)) == raw
+
+
+def test_json_codec_rejects_bytes():
+    """Raw bytes must raise rather than be silently stringified."""
+    with pytest.raises(KeyValueCodecEncodeException):
+        JsonKeyValueCodec().encode(b"hello")
+
+
+def test_json_codec_rejects_nested_bytes():

Review Comment:
   Good catch, parametrized it: dict keys, tuple, set, frozenset, `bytearray` 
and `memoryview` now each assert `KeyValueCodecEncodeException`.



-- 
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]

Reply via email to