Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove filterwarnings from tests for cross-version pandas compatibility #3522

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/examples_arguments_syntax/bump_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pandas as pd

stocks = data.stocks()
source = stocks.groupby([pd.Grouper(key="date", freq="6M"),"symbol"]).mean().reset_index()
source = stocks.groupby([pd.Grouper(key="date", freq="6MS"),"symbol"]).mean().reset_index()

alt.Chart(source).mark_line(point = True).encode(
x = alt.X("date:O", timeUnit="yearmonth", title="date"),
Expand Down
2 changes: 1 addition & 1 deletion tests/examples_methods_syntax/bump_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pandas as pd

stocks = data.stocks()
source = stocks.groupby([pd.Grouper(key="date", freq="6M"),"symbol"]).mean().reset_index()
source = stocks.groupby([pd.Grouper(key="date", freq="6MS"),"symbol"]).mean().reset_index()

alt.Chart(source).mark_line(point=True).encode(
x=alt.X("date:O").timeUnit("yearmonth").title("date"),
Expand Down
3 changes: 0 additions & 3 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def id_func(val) -> str:


@pytest.mark.filterwarnings(
"ignore:'M' is deprecated.*:FutureWarning",
"ignore:DataFrameGroupBy.apply.*:DeprecationWarning",
)
@pytest.mark.parametrize(("source", "filename"), distributed_examples, ids=id_func)
Expand All @@ -102,7 +101,6 @@ def test_render_examples_to_chart(source, filename) -> None:


@pytest.mark.filterwarnings(
"ignore:'M' is deprecated.*:FutureWarning",
"ignore:DataFrameGroupBy.apply.*:DeprecationWarning",
)
@pytest.mark.parametrize(("source", "filename"), distributed_examples, ids=id_func)
Expand Down Expand Up @@ -134,7 +132,6 @@ def test_from_and_to_json_roundtrip(source, filename) -> None:


@pytest.mark.filterwarnings(
"ignore:'M' is deprecated.*:FutureWarning",
"ignore:DataFrameGroupBy.apply.*:DeprecationWarning",
)
@pytest.mark.parametrize(("source", "filename"), distributed_examples, ids=id_func)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_transformed_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""Use as an `xfail` condition, if running in parallel may cause the test to fail."""

@pytest.mark.filterwarnings(
"ignore:'M' is deprecated.*:FutureWarning",
"ignore:DataFrameGroupBy.apply.*:DeprecationWarning"
)
@pytest.mark.skipif(vf is None, reason="vegafusion not installed")
Expand All @@ -29,7 +28,7 @@
("bar_chart_faceted_compact.py", 27, ["p", "p_end"]),
("beckers_barley_facet.py", 120, ["year", "site"]),
("beckers_barley_wrapped_facet.py", 120, ["site", "median_yield"]),
("bump_chart.py", 100, ["rank", "yearmonth_date"]),
("bump_chart.py", 96, ["rank", "yearmonth_date"]),
("comet_chart.py", 120, ["variety", "delta"]),
("diverging_stacked_bar_chart.py", 40, ["value", "percentage_start"]),
("donut_chart.py", 6, ["value_start", "value_end"]),
Expand Down
2 changes: 0 additions & 2 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def _check(arr, typ):
_check([], "nominal")


@pytest.mark.filterwarnings("ignore:'H' is deprecated.*:FutureWarning")
def test_sanitize_dataframe():
# create a dataframe with various types
df = pd.DataFrame(
Expand Down Expand Up @@ -129,7 +128,6 @@ def test_sanitize_dataframe_arrow_columns():
json.dumps(records)


@pytest.mark.filterwarnings("ignore:'H' is deprecated.*:FutureWarning")
@pytest.mark.skipif(pa is None, reason="pyarrow not installed")
@pytest.mark.xfail(
sys.platform == "win32", reason="Timezone database is not installed on Windows"
Expand Down
3 changes: 1 addition & 2 deletions tests/vegalite/v5/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,10 @@ def test_multiple_encodings(args, kwargs):
assert dct["encoding"]["tooltip"] == encoding_dct


@pytest.mark.filterwarnings("ignore:'Y' is deprecated.*:FutureWarning")
def test_chart_operations():
data = pd.DataFrame(
{
"x": pd.date_range("2012", periods=10, freq="Y"),
"x": pd.date_range("2012", periods=10, freq="YS"),
"y": range(10),
"c": list("abcabcabca"),
}
Expand Down