Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
fix windows int overflow
Browse files Browse the repository at this point in the history
- needs pd.to_numeric to avoid overflow
  • Loading branch information
RileyMShea committed Feb 21, 2021
1 parent 310be08 commit 889eef5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "upoly"
version = "0.1.31"
version = "0.1.32"
description = "High performance asyncio REST client for polygon.io"
authors = ["Riley <[email protected]>"]
license = "AGPL"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_upoly.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def test_version() -> None:
assert __version__ == "0.1.31"
assert __version__ == "0.1.32"


def test_create_dataset_from_polygon():
Expand Down
2 changes: 1 addition & 1 deletion upoly/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.31"
__version__ = "0.1.32"

from .polygon_plus import NY as NY
from .polygon_plus import async_polygon_aggs as async_polygon_aggs
6 changes: 3 additions & 3 deletions upoly/polygon_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ def async_polygon_aggs(

nyse: NYSEExchangeCalendar = mcal.get_calendar("NYSE")
schedule = nyse.schedule(start, end)
valid_minutes: pd.DatetimeIndex = mcal.date_range(schedule, "1min") - timedelta(
minutes=1
valid_minutes: pd.DatetimeIndex = mcal.date_range(schedule, "1min") - pd.Timedelta(
value=1, unit="T"
)

if df is None or df.empty:
print(f"No results for {symbol}.")
return None
df.t = pd.to_datetime(df.t.astype(int), unit="ms", utc=True)
df.t = pd.to_datetime(pd.to_numeric(df.t), unit="ms", utc=True)

This comment has been minimized.

Copy link
@RileyMShea

RileyMShea Feb 22, 2021

Author Owner

fix for windows

df.set_index("t", inplace=True)

expected_sessions = schedule.shape[0]
Expand Down

0 comments on commit 889eef5

Please sign in to comment.