diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 80dc9a443..38bbe13d4 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -134,7 +134,9 @@ class Backtesting(object): len(results[results.profit_abs > 0]), len(results[results.profit_abs < 0]) ]) - return tabulate(tabular_data, headers=headers, floatfmt=floatfmt, tablefmt="pipe") + # Ignore type as floatfmt does allow tuples but mypy does not know that + return tabulate(tabular_data, headers=headers, # type: ignore + floatfmt=floatfmt, tablefmt="pipe") def _generate_text_table_sell_reason(self, data: Dict[str, Dict], results: DataFrame) -> str: """ @@ -168,7 +170,9 @@ class Backtesting(object): len(results[results.profit_abs > 0]), len(results[results.profit_abs < 0]) ]) - return tabulate(tabular_data, headers=headers, floatfmt=floatfmt, tablefmt="pipe") + # Ignore type as floatfmt does allow tuples but mypy does not know that + return tabulate(tabular_data, headers=headers, # type: ignore + floatfmt=floatfmt, tablefmt="pipe") def _store_backtest_result(self, recordfilename: str, results: DataFrame, strategyname: Optional[str] = None) -> None: diff --git a/freqtrade/optimize/edge_cli.py b/freqtrade/optimize/edge_cli.py index a98f0c877..fdae47b99 100644 --- a/freqtrade/optimize/edge_cli.py +++ b/freqtrade/optimize/edge_cli.py @@ -67,7 +67,9 @@ class EdgeCli(object): round(result[1].avg_trade_duration) ]) - return tabulate(tabular_data, headers=headers, floatfmt=floatfmt, tablefmt="pipe") + # Ignore type as floatfmt does allow tuples but mypy does not know that + return tabulate(tabular_data, headers=headers, # type: ignore + floatfmt=floatfmt, tablefmt="pipe") def start(self) -> None: self.edge.calculate() diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index be2498d78..3ce7c9167 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -246,14 +246,14 @@ class Telegram(RPC): stake_cur, fiat_disp_cur ) - stats = tabulate(stats, - headers=[ - 'Day', - f'Profit {stake_cur}', - f'Profit {fiat_disp_cur}' - ], - tablefmt='simple') - message = f'Daily Profit over the last {timescale} days:\n
{stats}
' + stats_tab = tabulate(stats, + headers=[ + 'Day', + f'Profit {stake_cur}', + f'Profit {fiat_disp_cur}' + ], + tablefmt='simple') + message = f'Daily Profit over the last {timescale} days:\n
{stats_tab}
' self._send_msg(message, bot=bot, parse_mode=ParseMode.HTML) except RPCException as e: self._send_msg(str(e), bot=bot)