erichiggins / gaek

A collection of useful tools for Google App Engine.
MIT License
16 stars 6 forks source link

Update gaek to be compatible with Google Cloud NDB #20

Open vinaytota-optimizely opened 4 years ago

vinaytota-optimizely commented 4 years ago

Cloud NDB is a client library designed to replace App Engine NDB in apps that migrate from the App Engine Python 2.7 standard runtime to the Python 3 standard runtime.

Updating gaek to be cross compatible with both App Engine NDB and Cloud NDB would be extremely helpful to anyone who makes use of gaek currently, and wishes to move to Cloud NDB, while continuing to use gaek.

Based on an examination of the migration notes, it appears that there is at least one change which would break gaek, specifically the removal of google.appengine.api.namespace_manager which has no replacement.

erichiggins commented 4 years ago

Thanks for the filing this, @vinaytota-optimizely ! If I'm reading this right, there are three changes needed:

  1. Make gaek compatible with Python 3 (while maintaining 2.7 support)
  2. Offer the same JSON serialization/deserialization utilities for Cloud NDB
  3. Ensure that gaek can still be imported and used when the namespace_manager module is not available.

In terms of difficulty: 1 seems straightforward and 3 seems doable (throw a NotImplemented exception when called, don't break when imported). As for 2, I'm not yet sure how challenging that will be. I haven't worked with the Cloud NDB very much, so it's unclear what actually needs to be done on that front.

It sounds like Optimizely is working on migrating their app from the 2.7 runtime to 3? Do you have some idea of that timeframe?

vinaytota-optimizely commented 4 years ago

Thanks for the quick response @erichiggins !

Optimizely is indeed considering a migration from 2.7 to 3.x, and we are only at the beginning of the process. Once Cloud NDB is Python 2.7 compatible, we will likely attempt to integrate it into our existing 2.7 codebase. This is likely at least a month away, but once we reach this milestone we will be able to share any insights we might have with regards to 2, and what updates might be needed there.

erichiggins commented 4 years ago

@vinaytota-optimizely I haven't forgotten about this, just been busy with other work. The first task I'll likely focus on is Python 3.x support, which should at the very least allow you to import and continue using it, even if some of the APIs aren't all available.

PRs are welcome if you happen to have time to contribute some of these changes!

vinaytota-optimizely commented 4 years ago

@erichiggins No worries! This is not a blocker for us at present. We've decided to delay making use of Cloud NDB till it is a bit more stable, and at that point will likely more active on this issue.

erichiggins commented 4 years ago

Quick updates: