Skip to content

Commit 0585c30

Browse files
committed
3rd change after review
1 parent 293193e commit 0585c30

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/core/reshape/merge.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
is_datetime64tz_dtype, is_datetimelike, is_dtype_equal, is_float_dtype,
2121
is_int64_dtype, is_int_or_datetime_dtype, is_integer, is_integer_dtype,
2222
is_list_like, is_number, is_numeric_dtype, is_extension_array_dtype,
23-
needs_i8_conversion)
23+
is_period_dtype, needs_i8_conversion)
2424
from pandas.core.dtypes.missing import isnull, na_value_for_dtype
2525

2626
from pandas import Categorical, DataFrame, Index, MultiIndex, Series, Timedelta
@@ -1519,6 +1519,12 @@ def _factorize_keys(lk, rk, sort=True):
15191519

15201520
lk = ensure_int64(lk.codes)
15211521
rk = ensure_int64(rk)
1522+
elif (is_period_dtype(lk) and
1523+
is_period_dtype(rk) and
1524+
lk.dtype == rk.dtype):
1525+
klass = libhashtable.Factorizer
1526+
lk = ensure_object(lk)
1527+
rk = ensure_object(rk)
15221528
elif (is_extension_array_dtype(lk) and
15231529
is_extension_array_dtype(rk) and
15241530
lk.dtype == rk.dtype):

0 commit comments

Comments
 (0)