NannyML / nannyml

nannyml: post-deployment data science in python
https://www.nannyml.com/
Apache License 2.0
1.93k stars 138 forks source link

Optional dependency for database requirements #412

Closed Duncan-Hunter closed 1 month ago

Duncan-Hunter commented 2 months ago

Motivation: describe the problem to be solved The most recent version bumped up some requirements, specifically SQLAlchemy 2, which is a good thing and keeping dependencies up to date is important. However, it now forces me to migrate to SQLAlchemy 2 (which is something I should do), and install other database requirements, when it's not part of the library that I use. Something similar is mentioned here.

Describe the solution you'd like I'd like to add optional dependencies for the database module. As far as I can tell, it's only sqlmodel and maybe psycopg2-binary that would need an extra.

Describe alternatives you've considered just upgrading my internal SQLAlchemy library to handle version 2, which is something on my todo list.

Duncan-Hunter commented 2 months ago

And can I also tack on updating the s3fs and gcfs requirement, as it limits it to versions before 2023, which is kind of putting me in versioning hell

michael-nml commented 2 months ago

Hey @Duncan-Hunter, thank you for wanting to use the latest version of nannyml! You're right, being forced to update SQLAlchemy (and other dependencies you don't need) just to use nannyml really isn't intended.

Reducing the dependencies (or making them optional) has been on our to-do list for a while. Unfortunately we haven't had the time yet - sorry about that. I should be able to look into it in a few weeks. If it's urgent for you, do you want to take a stab at a PR for making the database module optional?

nnansters commented 1 month ago

Closed thanks to the wonderful contribution of @Duncan-Hunter !