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

REFACTOR-#6576: Don't use deprecated is_int64_dtype and is_period_dtype functions #6577

Merged
merged 1 commit into from
Sep 18, 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
is_datetime64_any_dtype,
is_datetime64_dtype,
is_float_dtype,
is_int64_dtype,
is_integer_dtype,
is_list_like,
is_numeric_dtype,
Expand Down Expand Up @@ -69,8 +68,8 @@ def _get_common_dtype(lhs_dtype, rhs_dtype):
return _get_dtype(int)
if is_datetime64_dtype(lhs_dtype) and is_datetime64_dtype(rhs_dtype):
return np.promote_types(lhs_dtype, rhs_dtype)
if (is_datetime64_dtype(lhs_dtype) and is_int64_dtype(rhs_dtype)) or (
is_datetime64_dtype(rhs_dtype) and is_int64_dtype(lhs_dtype)
if (is_datetime64_dtype(lhs_dtype) and rhs_dtype == np.int64) or (
is_datetime64_dtype(rhs_dtype) and (lhs_dtype == np.int64)
):
return _get_dtype(int)
raise NotImplementedError(
Expand Down
3 changes: 1 addition & 2 deletions modin/pandas/test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
is_list_like,
is_numeric_dtype,
is_object_dtype,
is_period_dtype,
is_string_dtype,
is_timedelta64_dtype,
)
Expand Down Expand Up @@ -650,7 +649,7 @@ def assert_dtypes_equal(df1, df2):
lambda obj: isinstance(obj, pandas.CategoricalDtype),
is_datetime64_any_dtype,
is_timedelta64_dtype,
is_period_dtype,
lambda obj: isinstance(obj, pandas.PeriodDtype),
)

for col in dtypes1.keys():
Expand Down