Skip to content

Commit

Permalink
Fixed tz in date filters, and default index por pd.DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
ggallohernandez committed Oct 16, 2020
1 parent 52025d1 commit 69ff460
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymatriz/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def _get_history_call(self, url_template, tickers, **kwargs):
responses = []

start_date = datetime.fromordinal(kwargs["start_date"].toordinal()).isoformat("T") + "Z" \
if "start_date" in kwargs else (datetime.today() - timedelta(days=1)).isoformat("T") + "Z"
if "start_date" in kwargs else (datetime.utcnow() - timedelta(days=1)).isoformat("T") + "Z"
end_date = datetime.fromordinal(kwargs["end_date"].toordinal()).isoformat("T") + "Z" \
if "end_date" in kwargs else (datetime.today()).isoformat("T") + "Z"
if "end_date" in kwargs else (datetime.utcnow() + timedelta(days=1)).isoformat("T") + "Z"

instruments = self.build_instruments(tickers, **kwargs)

Expand All @@ -162,7 +162,7 @@ def _get_history_call(self, url_template, tickers, **kwargs):
if HistoryFieldType.Time.value in df:
index.append(HistoryFieldType.Time.value)

df.set_index(index)
df.set_index(index, inplace=True)

return df

Expand Down

0 comments on commit 69ff460

Please sign in to comment.