From 2a7cef2b8e91b0d4e7b558fdc6bd4046012b940a Mon Sep 17 00:00:00 2001 From: Maxim Andreev Date: Mon, 29 Jan 2024 21:57:05 +0300 Subject: [PATCH] fix warnings --- investments/data_providers/moex.py | 4 ++-- investments/ibtax/report_presenter.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/investments/data_providers/moex.py b/investments/data_providers/moex.py index 64703f7..8331f7d 100644 --- a/investments/data_providers/moex.py +++ b/investments/data_providers/moex.py @@ -26,8 +26,8 @@ async def async_get_board_candles(ticker: Ticker, cache_dir: Optional[str], star for x in resp: if x['secid'] != ticker.symbol: continue - engine, market = x['group'].split('_') - board = x['primary_boardid'] + engine, market = str(x['group']).split('_') + board = str(x['primary_boardid']) if engine == '': raise Exception(f'unknown ticker {ticker}') diff --git a/investments/ibtax/report_presenter.py b/investments/ibtax/report_presenter.py index 14fb89d..dd9f20c 100644 --- a/investments/ibtax/report_presenter.py +++ b/investments/ibtax/report_presenter.py @@ -11,7 +11,7 @@ def apply_round_for_dataframe(source: pandas.DataFrame, columns: Iterable, digits: int = 2) -> pandas.DataFrame: - source[list(columns)] = source[list(columns)].applymap( + source[list(columns)] = source[list(columns)].map( lambda x: x.round(digits=digits) if isinstance(x, Money) else round(x, digits), ) return source