i recently migrated a number of nontrivial apps from python 2 to python 3 
(standard). it wasn't easy, especially since i used a number of the old 
APIs - task queues, logging, memcache, ndb, etc - that have changed 
significantly or disappeared entirely. it took a significant amount of 
effort, coding, and workarounds, but it was doable in the end. kudos in 
particular to chris rossi, danny hermes, carlos de la guardia, et al for 
the new python 3 ndb library <https://github.com/googleapis/python-ndb>!

i've posted many of the bigger gotchas i hit here on this list 
<https://groups.google.com/forum/#!topicsearchin/google-appengine/authorname$3A%22ryan$20b%22>,
 
and over 
<https://stackoverflow.com/questions/59398479/why-is-my-app-engine-app-hitting-the-stackdriver-logging-256kb-limit>
 on 
SO <https://stackoverflow.com/q/58753378/186123>, and on the python 3 ndb 
issue tracker 
<https://github.com/googleapis/python-ndb/issues?utf8=%E2%9C%93&q=is%3Aissue+author%3Asnarfed>.
 
beyond all those, two key things i ended up doing for ndb were:

* replace testbed 
<https://cloud.google.com/appengine/docs/standard/python/refdocs/google.appengine.ext.testbed>
 
with the datastore emulator 
<https://cloud.google.com/datastore/docs/tools/datastore-emulator> for 
running unit tests without mocking out ndb. example commands. 
<https://github.com/snarfed/granary#development>
* this WSGI middleware to run all HTTP request handlers inside an NDB 
client context. 
<https://github.com/snarfed/webutil/blob/master/handlers.py#L134-L151> 
without it, i would have had to add a ton of ugly new with 
ndb_client.context(): ... blocks and indents everywhere.

also, shameless plug, feel free to test things out in shell-py3.appspot.com, 
an interactive REPL inside python 3 GAE standard that includes the new ndb.

On Wednesday, January 15, 2020 at 5:27:12 AM UTC-8, Aert van de Hulsbeek 
wrote:
>
> We are currently looking to migrate a reasonable number of gae std 
> services from py2 to py3 and are tossing up between a datastore or cloud 
> ndb implementation.
> Has anyone done a somewhat complex migration from ndb to cloud ndb and 
> what was this experience like? I am mainly interested in unforeseen and 
> undocumented gotcha's / blockers that might direct us down the datastore 
> path.
> If anyone can share some hands-on experience, that would be fantastic. 
> Thanks, Aert.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/142c3da2-0871-43c1-be3c-0c7b6c0eb674%40googlegroups.com.

Reply via email to