ktmud commented on a change in pull request #12933:
URL: https://github.com/apache/superset/pull/12933#discussion_r569837081
##########
File path: tests/utils_tests.py
##########
@@ -1066,3 +1069,35 @@ def test_get_form_data_token(self):
assert get_form_data_token({"token": "token_abcdefg1"}) ==
"token_abcdefg1"
generated_token = get_form_data_token({})
assert re.match(r"^token_[a-z0-9]{8}$", generated_token) is not None
+
+ def test_extract_dataframe_dtypes(self):
+ df = pd.DataFrame(
+ data={
+ "dt": [date(2021, 2, 4), date(2021, 2, 4)],
+ "dttm": [datetime(2021, 2, 4, 1, 1, 1), datetime(2021, 2, 4,
1, 1, 1)],
+ "str": ["foo", "foo"],
+ "int": [1, 1],
+ "float": [0.5, 0.5],
+ "obj": [{"a": 1}, {"a": 1}],
+ "dt_null": [None, date(2021, 2, 4)],
+ "dttm_null": [None, datetime(2021, 2, 4, 1, 1, 1)],
+ "str_null": [None, "foo"],
+ "int_null": [None, 1],
+ "float_null": [None, 0.5],
+ "obj_null": [None, {"a": 1}],
+ }
Review comment:
Add test cases for booleans as well?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]