Skip to content

Commit

Permalink
pandas deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
realiti4 committed Oct 28, 2023
1 parent ba36f55 commit 359f357
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="tradingfeatures",
version="0.6.4",
version="0.6.5",
author="Onur Cetinkol",
author_email="realiti44@gmail.com",
description="A useful tool to download market history from popular exchanges.",
Expand Down
12 changes: 7 additions & 5 deletions tradingfeatures/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,18 @@ def get_hist(self,
try:
df_temp = self.get(symbol=symbol, interval=interval_str, start=str(start_batch), end=str(end_batch))
if df_temp is None: # Try this fix for other apis
print(' Debug: df_temp is empty')
assert len(df) == 0, 'Debug: empty df_temp in middle of download'
df_temp = df
print(' Warning: Got empty window from exchange at start')
assert len(df) == 0, 'Warning: Got empty window from exchange in middle of download'
df_temp = pd.DataFrame()
except Exception as e:
# raise e
print(e, '\nDebug: error between timestamps: ', start_batch, end_batch)
if steps <= 1: return None

df_temp = pd.concat([df, df_temp])
df = df_temp
if not (df.empty or df_temp.empty):
df = pd.concat([df, df_temp])
elif not df_temp.empty:
df = df_temp.copy()

if steps > verbose_after:
print('\r' + f' {i} of {steps}', end='')
Expand Down

0 comments on commit 359f357

Please sign in to comment.