Skip to content

Commit

Permalink
test: update tests, examples using deprecated pandas parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Jun 2, 2024
1 parent 3a1c640 commit 7b671db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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="6ME"),"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="6ME"),"symbol"]).mean().reset_index()

alt.Chart(source).mark_line(point=True).encode(
x=alt.X("date:O").timeUnit("yearmonth").title("date"),
Expand Down
8 changes: 4 additions & 4 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ def test_sanitize_dataframe():
"f": np.arange(5, dtype=float),
"i": np.arange(5, dtype=int),
"b": np.array([True, False, True, True, False]),
"d": pd.date_range("2012-01-01", periods=5, freq="H"),
"d": pd.date_range("2012-01-01", periods=5, freq="h"),
"c": pd.Series(list("ababc"), dtype="category"),
"c2": pd.Series([1, "A", 2.5, "B", None], dtype="category"),
"o": pd.Series([np.array(i) for i in range(5)]),
"p": pd.date_range("2012-01-01", periods=5, freq="H").tz_localize("UTC"),
"p": pd.date_range("2012-01-01", periods=5, freq="h").tz_localize("UTC"),
}
)

Expand Down Expand Up @@ -98,9 +98,9 @@ def test_sanitize_dataframe_arrow_columns():
"f": np.arange(5, dtype=float),
"i": np.arange(5, dtype=int),
"b": np.array([True, False, True, True, False]),
"d": pd.date_range("2012-01-01", periods=5, freq="H"),
"d": pd.date_range("2012-01-01", periods=5, freq="h"),
"c": pd.Series(list("ababc"), dtype="category"),
"p": pd.date_range("2012-01-01", periods=5, freq="H").tz_localize("UTC"),
"p": pd.date_range("2012-01-01", periods=5, freq="h").tz_localize("UTC"),
}
)
df_arrow = pa.Table.from_pandas(df).to_pandas(types_mapper=pd.ArrowDtype)
Expand Down
4 changes: 2 additions & 2 deletions tests/vegalite/v5/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def Chart(data):
def test_chart_infer_types():
data = pd.DataFrame(
{
"x": pd.date_range("2012", periods=10, freq="Y"),
"x": pd.date_range("2012", periods=10, freq="YE"),
"y": range(10),
"c": list("abcabcabca"),
"s": pd.Categorical([1, 2] * 5, categories=[2, 1], ordered=True),
Expand Down Expand Up @@ -220,7 +220,7 @@ def test_multiple_encodings(args, kwargs):
def test_chart_operations():
data = pd.DataFrame(
{
"x": pd.date_range("2012", periods=10, freq="Y"),
"x": pd.date_range("2012", periods=10, freq="YE"),
"y": range(10),
"c": list("abcabcabca"),
}
Expand Down

0 comments on commit 7b671db

Please sign in to comment.