| 414 | |
| 415 | |
| 416 | def test_empty_df_int64(backend): |
| 417 | # Load px data, then filter it such that the dataframe is empty |
| 418 | df = px.data.tips(return_type=backend) |
| 419 | df = nw.from_native(px.data.tips(return_type=backend)) |
| 420 | df_empty = df.filter(nw.col("day") == "banana").to_native() |
| 421 | |
| 422 | fig = px.scatter( |
| 423 | df_empty, |
| 424 | x="total_bill", |
| 425 | y="size", # size is an int64 column |
| 426 | ) |
| 427 | # to_dict() should not raise an exception |
| 428 | fig.to_dict() |
| 429 | |
| 430 | |
| 431 | @pytest.mark.parametrize("return_type", ["pandas", "polars", "pyarrow"]) |