Skip to content

Commit

Permalink
Fix for Pandas Series addressing with index instead of name.
Browse files Browse the repository at this point in the history
  • Loading branch information
titov-vv committed Jun 29, 2024
1 parent 4ad0bb8 commit 1e565e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jal/net/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _store_quotations(self, asset: JalAsset, currency_id: int, data: pd.DataFram
data.dropna(inplace=True)
quotations = []
for date, quote in data.iterrows(): # Date in pandas dataset is in UTC by default
quotations.append({'timestamp': int(date.timestamp()), 'quote': quote[0]})
quotations.append({'timestamp': int(date.timestamp()), 'quote': quote['Close']})
asset.set_quotes(quotations, currency_id)

def download_currency_rates(self, start_timestamp, end_timestamp):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_MOEX_details():
"type": PredefinedAsset.ETF}
assert QuoteDownloader.MOEX_info(isin='JE00B6T5S470', reg_number='', symbol='') == {'symbol': 'POLY',
'isin': 'JE00B6T5S470',
'name': 'Polymetal International plc',
'name': 'Solidcore Resources plc',
'principal': 0.03,
'type': PredefinedAsset.Stock}
assert QuoteDownloader.MOEX_info(isin='RU000A1038V6') == {'symbol': 'SU26238RMFS4',
Expand Down

0 comments on commit 1e565e1

Please sign in to comment.