在 python 的 Apache Beam 库中的什么地方可以找到 PCollection class?

Where can PCollection class be found in python's Apache Beam library?

我想要 class 在我的一些函数中获取类型信息。例如:

def process_words(words: PCollection, max_len: int) -> PCollection:
    some code...
    ...
    return processed_words

现在,为了定义 PCollection 类型,我需要导入 class。我应该从哪里导入?

您可以在 Beam 站点的 API 文档中找到它。是apache_beam.pvalue.PCollection.