eschutho commented on code in PR #32532:
URL: https://github.com/apache/superset/pull/32532#discussion_r1983913327


##########
tests/unit_tests/utils/json_tests.py:
##########
@@ -192,3 +216,57 @@ def test_sensitive_fields() -> None:
             "user_token": "NEW_TOKEN",
         },
     }
+
+
+def test_base_json_conv():
+    assert json.base_json_conv(np.bool_(1)) is True
+    assert json.base_json_conv(np.int64(1)) == 1
+    assert json.base_json_conv(np.array([1, 2, 3])) == [1, 2, 3]
+    assert json.base_json_conv(np.array(None)) is None
+    assert json.base_json_conv({1}) == [1]
+    assert json.base_json_conv(Decimal("1.0")) == 1.0
+    assert isinstance(json.base_json_conv(uuid.uuid4()), str)
+    assert json.base_json_conv(time(12, 0)) == "12:00:00"
+    assert json.base_json_conv(timedelta(0)) == "0:00:00"
+    assert json.base_json_conv(b"") == ""
+    assert isinstance(json.base_json_conv(b"\xff\xfe"), str)
+    assert json.base_json_conv(pd.DateOffset(days=1)) == "DateOffset(days=1)"

Review Comment:
   This is the test for this change



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