17
0

- Update to 0.41.2:

* Fix breaking change introduced on SQLAlchemy 2.0.22 changes to
    attributes.AttributeImpl constructor
- Drop patch sqlalchemy-2.0.22.patch:
  * Included upstream.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-SQLAlchemy-Utils?expand=0&rev=81
This commit is contained in:
2024-10-02 04:50:51 +00:00
committed by Git OBS Bridge
commit 819e55d42e
7 changed files with 638 additions and 0 deletions

28
sqlalchemy-2.0.22.patch Normal file
View File

@@ -0,0 +1,28 @@
From 712aabaefc5c8ca3680751c705cf5a5984c74af1 Mon Sep 17 00:00:00 2001
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
Date: Thu, 18 Jan 2024 11:02:54 +0100
Subject: [PATCH] Update GenericAttributeImpl to work with SqlAlchemy 2.0.22
Fix https://github.com/kvesteri/sqlalchemy-utils/issues/719
---
sqlalchemy_utils/generic.py | 7 +++++++
1 file changed, 7 insertions(+)
Index: SQLAlchemy-Utils-0.41.1/sqlalchemy_utils/generic.py
===================================================================
--- SQLAlchemy-Utils-0.41.1.orig/sqlalchemy_utils/generic.py
+++ SQLAlchemy-Utils-0.41.1/sqlalchemy_utils/generic.py
@@ -13,6 +13,13 @@ from .functions.orm import _get_class_re
class GenericAttributeImpl(attributes.ScalarAttributeImpl):
+ def __init__(self, *args, **kwargs):
+ # arguments received (class, key, dispatch)
+ # The attributes.AttributeImpl requires (class, key, default_function, dispatch)
+ # Setting None as default_function here
+ args = args[:2] + (None, ) + args[2:]
+ super().__init__(*args, **kwargs)
+
def get(self, state, dict_, passive=attributes.PASSIVE_OFF):
if self.key in dict_:
return dict_[self.key]