googleapis / googleapis/google-cloud-python

Docs: cache policy callables get passed datastore API `Key`, not ndb `Key`

Abierto
#15,841 4 comentarios 1 reacción 1 asignado Reclamado por @daniel-sanche Ver en GitHub
api: datastore priority: p3 type: bug
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

This took me a bit to debug just now, due to an error in the ndb docs, so I figured I'd file this to hopefully prevent that for others in the future. [The docs currently say](https://googleapis.dev/python/python-ndb/latest/context.html#google.cloud.ndb.context.Context.set_cache_policy) that the context `global_cache_timeout_policy` and (I think?) `global_cache_policy` callables get passed a `google.cloud.ndb.key.Key`, but that's not true. Evidently they actually get passed a [`google.cloud.datastore.key.Key`](https://cloud.google.com/python/docs/reference/datastore/latest/keys) instead.

Interestingly `cache_policy` gets passed a `google.cloud.ndb.key.Key`, which is documented correctly, but only adds to the confusion.

Hope this helps!

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.