modal-labs / modal-client

Python client library for Modal
https://modal.com/docs
Apache License 2.0
271 stars 35 forks source link

Add lookup backwards compatibility with pre 0.63 class methods #1939

Closed freider closed 3 months ago

freider commented 3 months ago

Adds back compatibility for Cls.lookup() of classes created by <v0.63

Old style classes had methods that were "fully qualified functions" themselves, each separately bound to the parametrization data, so some extra logic is required to make sure those work. We can remove the extra code when we phase out v0.62 in ~6 months

Also fixes some minor bugs and removes some unused code.

I've manually tested the code with both new and old classes.

Will try to add some test (using manually constructed mock data) for lookup/usage of old class methods, as we might want to keep this backwards compatibility around until we unsupport v0.62...

Changelog

Important: When updating (to >=v0.63) an app with a Modal class that's accessed using Cls.lookup() - make sure to update the client of the app/service using Cls.lookup() first, and then update the app containing the class being looked up.