From cc4430f49e531627d856fec448a7185410c37ec7 Mon Sep 17 00:00:00 2001 From: Noko-Github Date: Sun, 26 Nov 2023 23:03:11 +0900 Subject: [PATCH] Incorporate feedbacks. - Remove unnecessary fixture. - Refactoring. --- seaborn/_base.py | 4 ++-- tests/conftest.py | 5 ----- tests/test_relational.py | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/seaborn/_base.py b/seaborn/_base.py index 28f25dd91b..9aa83d408e 100644 --- a/seaborn/_base.py +++ b/seaborn/_base.py @@ -933,8 +933,8 @@ def iter_data( grouping_keys = [] for var in grouping_vars: - key = levels.get(var) if levels.get(var) is not None else [] - grouping_keys.append(key) + key = levels.get(var) + grouping_keys.append([] if key is None else key) iter_keys = itertools.product(*grouping_keys) if reverse: diff --git a/tests/conftest.py b/tests/conftest.py index dc13dda193..6ee53e7ee4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -166,11 +166,6 @@ def null_df(rng, long_df): return df -@pytest.fixture -def empty_df(long_df): - return long_df.drop(long_df.index) - - @pytest.fixture def object_df(rng, long_df): diff --git a/tests/test_relational.py b/tests/test_relational.py index b8a857660f..27fbaa8075 100644 --- a/tests/test_relational.py +++ b/tests/test_relational.py @@ -1219,7 +1219,7 @@ def test_lineplot_smoke( wide_df, wide_array, wide_list_of_series, wide_list_of_arrays, wide_list_of_lists, flat_array, flat_series, flat_list, - long_df, null_df, object_df, empty_df + long_df, null_df, object_df ): f, ax = plt.subplots() @@ -1302,7 +1302,7 @@ def test_lineplot_smoke( lineplot(x="x", y="y", hue="f", size="s", data=object_df) ax.clear() - lineplot(x="x", y="y", hue="a", data=empty_df) + lineplot(x="x", y="y", hue="a", data=long_df.iloc[:0]) ax.clear() def test_ci_deprecation(self, long_df):