Skip to content

Commit

Permalink
Merge pull request #165 from maread99/working
Browse files Browse the repository at this point in the history
Fix 163
  • Loading branch information
dpguthrie authored Mar 18, 2023
2 parents 444855e + e95865a commit 1f131ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions yahooquery/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ def _get_daily_index(data, index_utc, adj_timezone):
times = index_local.time

bv = times <= datetime.time(14)
if (bv).all():
index = index_local.floor("d")
if (bv).all() or data["meta"].get("exchangeName", "Nope") == "SAO": # see issue 163
index = index_local.floor("d", ambiguous=True)
elif (~bv).all():
index = index_local.ceil("d")
index = index_local.ceil("d", ambiguous=True)
else:
# mix of open times pre and post 14:00.
index1 = index_local[bv].floor("d")
index2 = index_local[~bv].ceil("d")
index1 = index_local[bv].floor("d", ambiguous=True)
index2 = index_local[~bv].ceil("d", ambiguous=True)
index = index1.union(index2)

index = pd.Index(index.date)
Expand Down

0 comments on commit 1f131ed

Please sign in to comment.