如何将objectId从bson封装导入到Apache Beam管道中(与Pymongo兼容)?

发布于 2025-02-13 23:35:22 字数 245 浏览 0 评论 0原文

嗨,我正在使用Google DataFlow中的管道,该管道加载了一些MongoDB文档(带有Pymongo)并进行处理。在某个时候,我需要将ID投入到mongoDB objectid。 为了施放它,我使用了BSON软件包,问题是使用DataFlowRunner未检测到软件包,我不明白为什么,因为我在setup.py中声明了pymongo [srv]。 如果我在设置中声明bson。 我知道Pymongo配备了自己的BSON包,但是如何在Apache Beam管道中提供它?

Hi I'm working on a pipeline in google Dataflow that loads some MongoDB documents (with pymongo) and process it. At some point I need to cast an id to a MongoDB ObjectId.
To cast it I use the bson package, the problem is that with the dataflowRunner is not detecting the package, and I don't understand why because I declared pymongo[srv] in setup.py.
If I declare bson in the setup.py I get an error because the installed bson dependency is not compatible with pymongo.
I know that pymongo comes with its own bson package but how can I make it available inside an Apache Beam pipeline?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文