googleapis / googleapis/google-cloud-python

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

未关闭
#15,841 4 条评论 1 个 reaction 已指派 1 人 已被 @daniel-sanche 认领 在 GitHub 查看
api: datastore priority: p3 type: bug
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

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!

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。