-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Address latest pandas-related upstream test failures #9081
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
Changes from all commits
891fd6e
bd875d3
616c179
1a3bdf6
334d118
36a005a
85c95a1
d181b97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,8 +139,7 @@ def test_groupby_da_datetime() -> None: | |
times = pd.date_range("2000-01-01", periods=4) | ||
foo = xr.DataArray([1, 2, 3, 4], coords=dict(time=times), dims="time") | ||
# create test index | ||
dd = times.to_pydatetime() | ||
reference_dates = [dd[0], dd[2]] | ||
reference_dates = [times[0], times[2]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, whether |
||
labels = reference_dates[0:1] * 2 + reference_dates[1:2] * 2 | ||
ind = xr.DataArray( | ||
labels, coords=dict(time=times), dims="time", name="reference_date" | ||
|
@@ -1881,7 +1880,7 @@ def test_resample_first(self) -> None: | |
array = Dataset({"time": times})["time"] | ||
actual = array.resample(time="1D").last() | ||
expected_times = pd.to_datetime( | ||
["2000-01-01T18", "2000-01-02T18", "2000-01-03T06"] | ||
["2000-01-01T18", "2000-01-02T18", "2000-01-03T06"], unit="ns" | ||
) | ||
expected = DataArray(expected_times, [("time", times[::4])], name="time") | ||
assert_identical(expected, actual) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
assert_equal, | ||
assert_identical, | ||
assert_no_warnings, | ||
has_pandas_3, | ||
raise_if_dask_computes, | ||
requires_bottleneck, | ||
requires_cupy, | ||
|
@@ -252,6 +253,7 @@ def test_0d_object_array_with_list(self): | |
assert_array_equal(x[0].data, listarray.squeeze()) | ||
assert_array_equal(x.squeeze().data, listarray.squeeze()) | ||
|
||
@pytest.mark.filterwarnings("ignore:Converting non-nanosecond") | ||
def test_index_and_concat_datetime(self): | ||
# regression test for #125 | ||
date_range = pd.date_range("2011-09-01", periods=10) | ||
|
@@ -2942,8 +2944,8 @@ def test_from_pint_wrapping_dask(self, Var): | |
(np.array([np.datetime64("2000-01-01", "ns")]), False), | ||
(np.array([np.datetime64("2000-01-01", "s")]), True), | ||
(pd.date_range("2000", periods=1), False), | ||
(datetime(2000, 1, 1), False), | ||
(np.array([datetime(2000, 1, 1)]), False), | ||
(datetime(2000, 1, 1), has_pandas_3), | ||
(np.array([datetime(2000, 1, 1)]), has_pandas_3), | ||
Comment on lines
+2947
to
+2948
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With pandas 3, |
||
(pd.date_range("2000", periods=1, tz=pytz.timezone("America/New_York")), False), | ||
( | ||
pd.Series( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pandas.to_datetime
will infer the precision from the input in pandas 3, so we explicitly specify the desired precision now.