Skip to content

Commit

Permalink
Merge pull request #133 from asweeney86/pandas-dtype
Browse files Browse the repository at this point in the history
ENH: Fix pandas DeprecationWarning for empty series
  • Loading branch information
gerrymanoim authored May 26, 2020
2 parents 0a1de07 + a8ee8d8 commit d0ddff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trading_calendars/trading_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ def _special_dates(self, calendars, ad_hoc_dates, start_date, end_date):
merged = regular + ad_hoc
if not merged:
# Concat barfs if the input has length 0.
return pd.Series([])
return pd.Series([], dtype="datetime64[ns, UTC]")

result = pd.concat(merged).sort_index()
return result.loc[(result >= start_date) & (result <= end_date)]
Expand Down

0 comments on commit d0ddff5

Please sign in to comment.