sadpandajoe commented on code in PR #40456:
URL: https://github.com/apache/superset/pull/40456#discussion_r3462437924


##########
tests/unit_tests/pandas_postprocessing/test_histogram.py:
##########
@@ -207,3 +207,13 @@ def test_histogram_with_no_groupby_and_all_null_values():
 
     result = histogram(data_with_no_groupby_and_all_nulls, "a", [], bins)
     assert result.empty
+
+
+def test_histogram_no_setting_with_copy_warning():
+    import warnings
+    from pandas.errors import SettingWithCopyWarning
+    source = DataFrame({"a": [1, 2, None, 4, 5], "b": list(range(5))})
+    with warnings.catch_warnings(record=True) as w:
+        warnings.simplefilter("always")
+        histogram(source.loc[source["b"] >= 0], "a", [], 3)

Review Comment:
   I believe this will still work even if you removed `.copy()`. Should verify 
this.



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