From 3b7288edaaa035b24b9c47a9e458fd63c807d2f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:13:08 +0000 Subject: [PATCH 1/3] Bump sqlalchemy from 2.0.23 to 2.0.25 Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.23 to 2.0.25. - [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases) - [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst) - [Commits](https://github.com/sqlalchemy/sqlalchemy/commits) --- updated-dependencies: - dependency-name: sqlalchemy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index da17047ea..9b8f9cb2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ pandas-ta==0.3.14b ccxt==4.2.9 cryptography==41.0.7 aiohttp==3.9.1 -SQLAlchemy==2.0.23 +SQLAlchemy==2.0.25 python-telegram-bot==20.7 # can't be hard-pinned due to telegram-bot pinning httpx with ~ httpx>=0.24.1 From 34c1838566a9531ee6c5844c0864f9009a7aef1c Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 8 Jan 2024 07:04:14 +0100 Subject: [PATCH 2/3] Bump Sqlalchemy in pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6ea411be..4055eb3ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - types-requests==2.31.0.20240106 - types-tabulate==0.9.0.20240106 - types-python-dateutil==2.8.19.20240106 - - SQLAlchemy==2.0.23 + - SQLAlchemy==2.0.25 # stages: [push] - repo: https://github.com/pycqa/isort From 962417bdea3d6cc1872007b83f431ed7e20f8e53 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 8 Jan 2024 07:06:41 +0100 Subject: [PATCH 3/3] Update typing to account for correctly typed sqlalchemy responses --- freqtrade/persistence/trade_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/persistence/trade_model.py b/freqtrade/persistence/trade_model.py index 42004867d..02a06e8e5 100644 --- a/freqtrade/persistence/trade_model.py +++ b/freqtrade/persistence/trade_model.py @@ -1637,7 +1637,7 @@ class Trade(ModelBase, LocalTrade): Retrieves total realized profit """ if Trade.use_db: - total_profit: float = Trade.session.execute( + total_profit = Trade.session.execute( select(func.sum(Trade.close_profit_abs)).filter(Trade.is_open.is_(False)) ).scalar_one() else: @@ -1845,4 +1845,4 @@ class Trade(ModelBase, LocalTrade): Order.order_filled_date >= start_date, Order.status == 'closed' )).scalar_one() - return trading_volume + return trading_volume or 0.0