Skip to content

Commit

Permalink
Cast locator with index type (ray-project#2274)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored and devin-petersohn committed Jun 21, 2018
1 parent aa5daa1 commit b108419
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/ray/dataframe/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ def _compute_enlarge_labels(self, locator, base_index):
Returns:
nan_labels: The labels needs to be added
"""
locator_as_index = pandas.Index(locator)
# base_index_type can be pd.Index or pd.DatetimeIndex
# depending on user input and pandas behavior
# See issue #2264
base_index_type = type(base_index)
locator_as_index = base_index_type(locator)

nan_labels = locator_as_index.difference(base_index)
common_labels = locator_as_index.intersection(base_index)
Expand Down

0 comments on commit b108419

Please sign in to comment.