Skip to content

Update GenericAttributeImpl to work with SqlAlchemy 2.0.22#725

Merged
kurtmckee merged 1 commit into
kvesteri:masterfrom
danigm:sqlalchemy-2.0.22
Jan 31, 2024
Merged

Update GenericAttributeImpl to work with SqlAlchemy 2.0.22#725
kurtmckee merged 1 commit into
kvesteri:masterfrom
danigm:sqlalchemy-2.0.22

Conversation

@danigm

@danigm danigm commented Jan 18, 2024

Copy link
Copy Markdown
Contributor

This change fixes the issue, but I'm not sure if this should be fixed in SQLAlchemy directly.

I've been debugging and found the problem in this call where there's a missing parameter. Looks like the AttributeImpl class now requires 4 positional parameters, and the register_attribute mapping is not calling this correctly.

Fix #719

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jan 18, 2024
https://build.opensuse.org/request/show/1139684
by user dgarcia + anag+factory
- Add sqlalchemy-2.0.22.patch to make it compatible with
  SQLAlchemy>=2.0.22, gh#kvesteri/sqlalchemy-utils#725
@josecsotomorales

Copy link
Copy Markdown
Collaborator

Reported this issue sqlalchemy-continuum/sqlalchemy-continuum#339 and ended up here, what's needed to merge this PR?

@josecsotomorales

Copy link
Copy Markdown
Collaborator

@kurtmckee can you take a look at this?

@stabacco

Copy link
Copy Markdown

I'm also interested in this to be merged. Currently I have to pin the sqlalchemy version to 2.0.21

@kurtmckee

Copy link
Copy Markdown
Collaborator

Test suite appears to be failing for unrelated reasons.

@danigm Thanks for contributing this fix!

@kurtmckee kurtmckee merged commit 00d8000 into kvesteri:master Jan 31, 2024
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 7, 2024
https://build.opensuse.org/request/show/1139684
by user dgarcia + anag+factory
- Add sqlalchemy-2.0.22.patch to make it compatible with
  SQLAlchemy>=2.0.22, gh#kvesteri/sqlalchemy-utils#725
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 7, 2024
https://build.opensuse.org/request/show/1139684
by user dgarcia + anag+factory
- Add sqlalchemy-2.0.22.patch to make it compatible with
  SQLAlchemy>=2.0.22, gh#kvesteri/sqlalchemy-utils#725
@josecsotomorales

Copy link
Copy Markdown
Collaborator

@kurtmckee @kvesteri happy to be a contributor to this project to get this released

@marksteward

Copy link
Copy Markdown
Collaborator

Does this fix retain compatibility with 2.0.21?

@marksteward

marksteward commented Mar 21, 2024

Copy link
Copy Markdown
Collaborator

I've tested this and I don't think it does the right thing for sqla < 2.0.22, including 1.4.

register_attribute_impl is actually called a few lines above, which has a different signature. Previously they all took 4 positional arguments.

So to avoid breaking anyone who doesn't immediately update to 2.0.22, I think this code needs to count the number of args, and only add the extra typecallable if needed. Though it's not clear to me that it was ever appropriate to pass typecallable in as callable_. Frankly this whole thing needs rewriting.

@josecsotomorales

Copy link
Copy Markdown
Collaborator

@marksteward I haven't looked at this yet, this was merged to master tough, I will try to get tests to at least pass with the current master version in this PR first, then come back to this, if you can help with a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generic_relationship breaks with SqlAlchemy 2.0.22

5 participants