]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix: add missing `dialect` parameter to bind_processor 12534/head
authorShamil <ashm.tech@proton.me>
Thu, 17 Apr 2025 14:59:08 +0000 (17:59 +0300)
committerShamil <ashm.tech@proton.me>
Thu, 17 Apr 2025 14:59:08 +0000 (17:59 +0300)
Fixed a missing `dialect` parameter in the bind_processor method of _DateTimeBase, avoiding potential runtime errors.
Added a comment to clarify grouping rows by constraint ID for multi-column foreign keys.

lib/sqlalchemy/dialects/mssql/base.py

index 937eedf9c3b077f2ddf8345e68a83837d195a761..2931a53abb2d9345f6e7832b39ceb878bd4734a8 100644 (file)
@@ -1324,7 +1324,7 @@ class _BASETIMEIMPL(TIME):
 
 
 class _DateTimeBase:
-    def bind_processor(self):
+    def bind_processor(self, dialect):
         def process(value):
             if type(value) == datetime.date:
                 return datetime.datetime(value.year, value.month, value.day)
@@ -3949,6 +3949,7 @@ index_info AS (
             )
         )
 
+        # group rows by constraint ID, to handle multi-column FKs
         fkeys = util.defaultdict(
             lambda: {
                 "name": None,