Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GenericAttributeImpl to work with SqlAlchemy 2.0.22 #725

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

danigm
Copy link
Contributor

@danigm danigm commented Jan 18, 2024

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
Collaborator

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

@josecsotomorales
Copy link
Collaborator

@kurtmckee can you take a look at this?

@stabacco
Copy link

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

@kurtmckee
Copy link
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
8 of 13 checks passed
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
Collaborator

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

@marksteward
Copy link
Collaborator

Does this fix retain compatibility with 2.0.21?

@marksteward
Copy link
Collaborator

marksteward commented Mar 21, 2024

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
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