googleapis / googleapis/google-cloud-python

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

Aperta
#15,841 4 commenti 1 reazione 1 assegnatario Rivendicata da @daniel-sanche Vedi su GitHub
api: datastore priority: p3 type: bug
Lingua principale
Python
Stelle
5.4k
Fork
1.8k
Merge medio
3g 4h
PR unite (30g)
122

Descrizione

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!

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.