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

Fix typing issues in tests #8312

Merged
merged 2 commits into from
Oct 16, 2023
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
1 change: 1 addition & 0 deletions xarray/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def test_lazily_indexed_array(self) -> None:
assert expected.shape == actual.shape
assert_array_equal(expected, actual)
assert isinstance(actual._data, indexing.LazilyIndexedArray)
assert isinstance(v_lazy._data, indexing.LazilyIndexedArray)

# make sure actual.key is appropriate type
if all(
Expand Down
2 changes: 2 additions & 0 deletions xarray/tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,7 @@ def test_datetime_conversion_warning(values, warns_under_pandas_version_two) ->
# The only case where a non-datetime64 dtype can occur currently is in
# the case that the variable is backed by a timezone-aware
# DatetimeIndex, and thus is hidden within the PandasIndexingAdapter class.
assert isinstance(var._data, PandasIndexingAdapter)
assert var._data.array.dtype == pd.DatetimeTZDtype(
"ns", pytz.timezone("America/New_York")
)
Expand Down Expand Up @@ -2978,6 +2979,7 @@ def test_pandas_two_only_datetime_conversion_warnings() -> None:
# The only case where a non-datetime64 dtype can occur currently is in
# the case that the variable is backed by a timezone-aware
# DatetimeIndex, and thus is hidden within the PandasIndexingAdapter class.
assert isinstance(var._data, PandasIndexingAdapter)
assert var._data.array.dtype == pd.DatetimeTZDtype(
"ns", pytz.timezone("America/New_York")
)
Expand Down