Skip to content

Commit 55130b0

Browse files
committed
3rd change after review
1 parent 98245ec commit 55130b0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pandas/core/reshape/merge.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
is_bool_dtype, is_categorical_dtype, is_datetime64_dtype,
2020
is_datetime64tz_dtype, is_datetimelike, is_dtype_equal, is_float_dtype,
2121
is_int64_dtype, is_integer, is_integer_dtype, is_list_like, is_number,
22-
is_numeric_dtype, needs_i8_conversion, is_extension_array_dtype)
22+
is_numeric_dtype, needs_i8_conversion, is_extension_array_dtype,
23+
is_period_dtype)
2324
from pandas.core.dtypes.missing import isnull, na_value_for_dtype
2425

2526
from pandas import Categorical, DataFrame, Index, MultiIndex, Series, Timedelta
@@ -1605,6 +1606,12 @@ def _factorize_keys(lk, rk, sort=True):
16051606

16061607
lk = ensure_int64(lk.codes)
16071608
rk = ensure_int64(rk)
1609+
elif (is_period_dtype(lk) and
1610+
is_period_dtype(rk) and
1611+
lk.dtype == rk.dtype):
1612+
klass = libhashtable.Factorizer
1613+
lk = ensure_object(lk)
1614+
rk = ensure_object(rk)
16081615
elif (is_extension_array_dtype(lk) and
16091616
is_extension_array_dtype(rk) and
16101617
lk.dtype == rk.dtype):

0 commit comments

Comments
 (0)