From 3912e1306fa4c7a137baaddd45f4b9dc7919f482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bertin?= Date: Fri, 4 Apr 2025 18:01:30 +0200 Subject: [PATCH 1/3] chore(dependencies): Update requirement for sqlparse 0.4.4 -> ~0.5.0 --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index cb8a4ea4..e3312679 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # THIS FILE WAS CHANGED ON - 19 Aug 2022 -sqlparse==0.4.4 +sqlparse~=0.5.0 pymongo>=3.6.0,<4.0 django>=3.2 # requirements.txt diff --git a/setup.py b/setup.py index 41d0157f..292fa5e3 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ def find_version(*file_paths): install_requires = [ - 'sqlparse==0.4.4', + 'sqlparse~=0.5.0', 'pymongo>=3.6.0', 'django>=3.2', ] From ea8a08f4a6733452109dbd28fcc9d20e8c762336 Mon Sep 17 00:00:00 2001 From: Fabien Amelinck Date: Thu, 9 Jul 2026 17:56:56 +0200 Subject: [PATCH 2/3] fix(database): pymongo error on high load --- djongo/base.py | 6 +++--- djongo/database.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/djongo/base.py b/djongo/base.py index ba6766d7..61b0e5b8 100644 --- a/djongo/base.py +++ b/djongo/base.py @@ -169,9 +169,9 @@ def get_new_connection(self, connection_params): # To prevent leaving unclosed connections behind, # client_conn must be closed before a new connection # is created. - if self.client_connection is not None: - self.client_connection.close() - logger.debug('Existing MongoClient connection closed') + # if self.client_connection is not None: + # self.client_connection.close() + # logger.debug('Existing MongoClient connection closed') self.client_connection = Database.connect(db=name, **connection_params) logger.debug('New Database connection') diff --git a/djongo/database.py b/djongo/database.py index 79ecf283..15d01cd1 100644 --- a/djongo/database.py +++ b/djongo/database.py @@ -9,7 +9,7 @@ def connect(db, **kwargs): logger.debug('New MongoClient connection') - clients[db] = MongoClient(**kwargs, connect=False) + clients[db] = MongoClient(**kwargs, connect=True) return clients[db] From ae2ffbf90fee644b2f304452266c5f0e88d20e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bertin?= Date: Fri, 10 Jul 2026 09:50:43 +0200 Subject: [PATCH 3/3] chore: remove commented code --- djongo/base.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/djongo/base.py b/djongo/base.py index 61b0e5b8..7a1d5165 100644 --- a/djongo/base.py +++ b/djongo/base.py @@ -169,9 +169,6 @@ def get_new_connection(self, connection_params): # To prevent leaving unclosed connections behind, # client_conn must be closed before a new connection # is created. - # if self.client_connection is not None: - # self.client_connection.close() - # logger.debug('Existing MongoClient connection closed') self.client_connection = Database.connect(db=name, **connection_params) logger.debug('New Database connection')