memgraph / gqlalchemy

GQLAlchemy is a library developed with the purpose of assisting in writing and running queries on Memgraph. GQLAlchemy supports high-level connection to Memgraph as well as modular query builder.
https://pypi.org/project/gqlalchemy/
Apache License 2.0
227 stars 32 forks source link

Pydantic version #295

Closed jpmmcneill closed 10 months ago

jpmmcneill commented 11 months ago

Hi, thank you for building this package. It looks like it could be very helpful for a hobby project i'm working on

Your pydantic version requirement is very strict. Does it have to be so specific?

Pydantic is a very common library and in my (extremely low requirements) project, poetry can't resolve a way to use gqlalchemy with it's current reqs.

Thank you! James

jpmmcneill commented 11 months ago

https://github.com/memgraph/gqlalchemy/pull/278/ this is the PR that added this requirement. I imagine it was a mistake to pin it to a patch based on the context of this pr.

katarinasupe commented 11 months ago

Hi @jpmmcneill, glad to hear you like the project 😄 What are you working on for your hobby project? We did discussed making it minor or patch, and by your comment, I could say we didn't think it well enough. But, to allow users to use v1 and v2 pydantic in their projects (since users were looking for both), we found a workaround of importing pydantic.v1 in projects where you'd like to use v1 (e.g. - https://github.com/memgraph/gqlalchemy/pull/278/files#diff-09f64bc569acbae4645862ef2ab8e09608f050548d746e0ad57f8a457e305584R17). We do this now in GQLAlchemy, although v2 of Pydantic is installed with the library. Does this work for you?

jpmmcneill commented 10 months ago

@katarinasupe hey, thanks for the response. My hobby project is using Kuzu as a backend for an application that stores data about fantasy worlds (ideally useful for those of us who run tabletop role playing games like Dungeons and Dragons).

My point is that I very much doubt that GQLalchemy depends on pydantic 2.3.0 exactly, and this pinning discourages me from using the package. I'd need to base my version of pydantic entirely on. gqlalchemy, and then some other packages that are dependent on pydantic would often not be installable.

Do you know the context around why this pin was made? To be honest, pydantic is a widely adopted package, so I do not think there is a risk in unpinning this dependendy.

katarinasupe commented 10 months ago

Cool project! 😄 @as51340, do you remember why we used 2.3.0 as an exact version for Pydantic? Was there any specific reason?

as51340 commented 10 months ago

Because we had a request to upgrade pydantic v2. I will try to improve this

as51340 commented 10 months ago

@jpmmcneill You are right, gqlalchemy doesn't need to depend exactly on 2.3.0. However, since the main goal was just to support easy migration from pydantic.v1 to v2, it did its job. I will try up improve this behavior today and @katarinasupe will let you know if it's been fixed.

jpmmcneill commented 10 months ago

Thank you so much @katarinasupe @as51340. Much appreciated.

Unrelated but I am not sure how the integration with kuzu will go. I am happy to contribute back if I run into issues of course.

as51340 commented 10 months ago

I don't know but am also very interested, don't know if anyone had experimented with Kuzu and Gqla yet. Looking forward to see results!

as51340 commented 10 months ago

@jpmmcneill Just to check is 2.3.0 good enough for you? We are trying to support all versions compatible with 2.3.0. This means that versions between 2.0 and 2.3 may not work.

katarinasupe commented 10 months ago

Glad to help @jpmmcneill! I am definitely interested in seeing how the integration will go. If you haven't, you can join our Discord for quicker communication and feedback 😄

jpmmcneill commented 10 months ago

@as51340 I think>=2.3 is fine. Pydantic is 2.5 now and it is a well resourced project so I cannot imagine it would be difficult for users to update a few minor versions once on v2