blob: f94ac87d2a8ec96f48215451c80b6764270ab712 [file] [log] [blame]
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>apache_beam.pvalue module &mdash; Apache Beam 2.68.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=2388e03a"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="apache_beam.pipeline module" href="apache_beam.pipeline.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
Apache Beam
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.coders.html">apache_beam.coders package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.dataframe.html">apache_beam.dataframe package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.io.html">apache_beam.io package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.metrics.html">apache_beam.metrics package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.ml.html">apache_beam.ml package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.options.html">apache_beam.options package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.portability.html">apache_beam.portability package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.runners.html">apache_beam.runners package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.testing.html">apache_beam.testing package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.transforms.html">apache_beam.transforms package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.typehints.html">apache_beam.typehints package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.utils.html">apache_beam.utils package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.yaml.html">apache_beam.yaml package</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="apache_beam.error.html">apache_beam.error module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.pipeline.html">apache_beam.pipeline module</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">apache_beam.pvalue module</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.PCollection"><code class="docutils literal notranslate"><span class="pre">PCollection</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.PCollection.windowing"><code class="docutils literal notranslate"><span class="pre">PCollection.windowing</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.PCollection.from_"><code class="docutils literal notranslate"><span class="pre">PCollection.from_()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.PCollection.to_runner_api"><code class="docutils literal notranslate"><span class="pre">PCollection.to_runner_api()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.PCollection.from_runner_api"><code class="docutils literal notranslate"><span class="pre">PCollection.from_runner_api()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.TaggedOutput"><code class="docutils literal notranslate"><span class="pre">TaggedOutput</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.AsSideInput"><code class="docutils literal notranslate"><span class="pre">AsSideInput</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsSideInput.element_type"><code class="docutils literal notranslate"><span class="pre">AsSideInput.element_type</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsSideInput.to_runner_api"><code class="docutils literal notranslate"><span class="pre">AsSideInput.to_runner_api()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsSideInput.from_runner_api"><code class="docutils literal notranslate"><span class="pre">AsSideInput.from_runner_api()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsSideInput.requires_keyed_input"><code class="docutils literal notranslate"><span class="pre">AsSideInput.requires_keyed_input()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.AsSingleton"><code class="docutils literal notranslate"><span class="pre">AsSingleton</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsSingleton.element_type"><code class="docutils literal notranslate"><span class="pre">AsSingleton.element_type</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.AsIter"><code class="docutils literal notranslate"><span class="pre">AsIter</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsIter.element_type"><code class="docutils literal notranslate"><span class="pre">AsIter.element_type</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.AsList"><code class="docutils literal notranslate"><span class="pre">AsList</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.AsDict"><code class="docutils literal notranslate"><span class="pre">AsDict</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.AsMultiMap"><code class="docutils literal notranslate"><span class="pre">AsMultiMap</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.AsMultiMap.requires_keyed_input"><code class="docutils literal notranslate"><span class="pre">AsMultiMap.requires_keyed_input()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.EmptySideInput"><code class="docutils literal notranslate"><span class="pre">EmptySideInput</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#apache_beam.pvalue.Row"><code class="docutils literal notranslate"><span class="pre">Row</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#apache_beam.pvalue.Row.as_dict"><code class="docutils literal notranslate"><span class="pre">Row.as_dict()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Apache Beam</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">apache_beam.pvalue module</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/apache_beam.pvalue.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="module-apache_beam.pvalue">
<span id="apache-beam-pvalue-module"></span><h1>apache_beam.pvalue module<a class="headerlink" href="#module-apache_beam.pvalue" title="Link to this heading"></a></h1>
<p>PValue, PCollection: one node of a dataflow graph.</p>
<p>A node of a dataflow processing graph is a PValue. Currently, there is only
one type: PCollection (a potentially very large set of arbitrary values).
Once created, a PValue belongs to a pipeline and has an associated
transform (of type PTransform), which describes how the value will be
produced when the pipeline gets executed.</p>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.PCollection">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">PCollection</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pipeline</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.pipeline.html#apache_beam.pipeline.Pipeline" title="apache_beam.pipeline.Pipeline"><span class="pre">Pipeline</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">tag</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">element_type</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.13)"><span class="pre">type</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">typehints.TypeConstraint</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">windowing</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.transforms.core.html#apache_beam.transforms.core.Windowing" title="apache_beam.transforms.core.Windowing"><span class="pre">Windowing</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_bounded</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#PCollection"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.PCollection" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">PValue</span></code>, <a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Generic" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Generic</span></code></a>[<code class="xref py py-obj docutils literal notranslate"><span class="pre">T</span></code>]</p>
<p>A multiple values (potentially huge) container.</p>
<p>Dataflow users should not construct PCollection objects directly in their
pipelines.</p>
<p>Initializes a PValue with all arguments hidden behind keyword arguments.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pipeline</strong> – Pipeline object for this PValue.</p></li>
<li><p><strong>tag</strong> – Tag of this PValue.</p></li>
<li><p><strong>element_type</strong> – The type of this PValue.</p></li>
</ul>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="apache_beam.pvalue.PCollection.windowing">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">windowing</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="apache_beam.transforms.core.html#apache_beam.transforms.core.Windowing" title="apache_beam.transforms.core.Windowing"><span class="pre">Windowing</span></a></em><a class="headerlink" href="#apache_beam.pvalue.PCollection.windowing" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.PCollection.from_">
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">PValue</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_bounded</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.13)"><span class="pre">bool</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></span><a class="reference internal" href="_modules/apache_beam/pvalue.html#PCollection.from_"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.PCollection.from_" title="Link to this definition"></a></dt>
<dd><p>Create a PCollection, using another PCollection as a starting point.</p>
<p>Transfers relevant attributes.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.PCollection.to_runner_api">
<span class="sig-name descname"><span class="pre">to_runner_api</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.io.iobase.html#apache_beam.io.iobase.Read.PipelineContext" title="apache_beam.io.iobase.Read.PipelineContext"><span class="pre">PipelineContext</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">PCollection</span></span></span><a class="reference internal" href="_modules/apache_beam/pvalue.html#PCollection.to_runner_api"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.PCollection.to_runner_api" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.PCollection.from_runner_api">
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_runner_api</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">proto</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">PCollection</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.io.iobase.html#apache_beam.io.iobase.Read.PipelineContext" title="apache_beam.io.iobase.Read.PipelineContext"><span class="pre">PipelineContext</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></span><a class="reference internal" href="_modules/apache_beam/pvalue.html#PCollection.from_runner_api"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.PCollection.from_runner_api" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.TaggedOutput">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">TaggedOutput</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tag</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.13)"><span class="pre">Any</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#TaggedOutput"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.TaggedOutput" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>An object representing a tagged value.</p>
<p>ParDo, Map, and FlatMap transforms can emit values on multiple outputs which
are distinguished by string tags. The DoFn will return plain values
if it wants to emit on the main output and TaggedOutput objects
if it wants to emit a value on a specific tagged output.</p>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSideInput">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">AsSideInput</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsSideInput"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsSideInput" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Marker specifying that a PCollection will be used as a side input.</p>
<p>When a PCollection is supplied as a side input to a PTransform, it is
necessary to indicate how the PCollection should be made available
as a PTransform side argument (e.g. in the form of an iterable, mapping,
or single value). This class is the superclass of all the various
options, and should not be instantiated directly. (See instead AsSingleton,
AsIter, etc.)</p>
<dl class="py property">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSideInput.element_type">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">element_type</span></span><a class="headerlink" href="#apache_beam.pvalue.AsSideInput.element_type" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSideInput.to_runner_api">
<span class="sig-name descname"><span class="pre">to_runner_api</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.io.iobase.html#apache_beam.io.iobase.Read.PipelineContext" title="apache_beam.io.iobase.Read.PipelineContext"><span class="pre">PipelineContext</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">SideInput</span></span></span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsSideInput.to_runner_api"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsSideInput.to_runner_api" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSideInput.from_runner_api">
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_runner_api</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">proto</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">SideInput</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.io.iobase.html#apache_beam.io.iobase.Read.PipelineContext" title="apache_beam.io.iobase.Read.PipelineContext"><span class="pre">PipelineContext</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">_UnpickledSideInput</span></span></span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsSideInput.from_runner_api"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsSideInput.from_runner_api" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSideInput.requires_keyed_input">
<span class="sig-name descname"><span class="pre">requires_keyed_input</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsSideInput.requires_keyed_input"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsSideInput.requires_keyed_input" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSingleton">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">AsSingleton</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll:</span> <span class="pre">~apache_beam.pvalue.PCollection</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_value:</span> <span class="pre">~typing.Any</span> <span class="pre">=</span> <span class="pre">&lt;object</span> <span class="pre">object&gt;</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsSingleton"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsSingleton" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#apache_beam.pvalue.AsSideInput" title="apache_beam.pvalue.AsSideInput"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsSideInput</span></code></a></p>
<p>Marker specifying that an entire PCollection is to be used as a side input.</p>
<p>When a PCollection is supplied as a side input to a PTransform, it is
necessary to indicate whether the entire PCollection should be made available
as a PTransform side argument (in the form of an iterable), or whether just
one value should be pulled from the PCollection and supplied as the side
argument (as an ordinary value).</p>
<p>Wrapping a PCollection side input argument to a PTransform in this container
(e.g., data.apply(‘label’, MyPTransform(), AsSingleton(my_side_input) )
selects the latter behavior.</p>
<p>The input PCollection must contain exactly one value per window, unless a
default is given, in which case it may be empty.</p>
<dl class="py property">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsSingleton.element_type">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">element_type</span></span><a class="headerlink" href="#apache_beam.pvalue.AsSingleton.element_type" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsIter">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">AsIter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsIter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsIter" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#apache_beam.pvalue.AsSideInput" title="apache_beam.pvalue.AsSideInput"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsSideInput</span></code></a></p>
<p>Marker specifying that an entire PCollection is to be used as a side input.</p>
<p>When a PCollection is supplied as a side input to a PTransform, it is
necessary to indicate whether the entire PCollection should be made available
as a PTransform side argument (in the form of an iterable), or whether just
one value should be pulled from the PCollection and supplied as the side
argument (as an ordinary value).</p>
<p>Wrapping a PCollection side input argument to a PTransform in this container
(e.g., data.apply(‘label’, MyPTransform(), AsIter(my_side_input) ) selects the
former behavor.</p>
<dl class="py property">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsIter.element_type">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">element_type</span></span><a class="headerlink" href="#apache_beam.pvalue.AsIter.element_type" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsList">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">AsList</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsList"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsList" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#apache_beam.pvalue.AsSideInput" title="apache_beam.pvalue.AsSideInput"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsSideInput</span></code></a></p>
<p>Marker specifying that an entire PCollection is to be used as a side input.</p>
<p>Intended for use in side-argument specification—the same places where
AsSingleton and AsIter are used, but forces materialization of this
PCollection as a list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pcoll</strong> – Input pcollection.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An AsList-wrapper around a PCollection whose one element is a list
containing all elements in pcoll.</p>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsDict">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">AsDict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsDict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsDict" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#apache_beam.pvalue.AsSideInput" title="apache_beam.pvalue.AsSideInput"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsSideInput</span></code></a></p>
<p>Marker specifying a PCollection to be used as an indexable side input.</p>
<p>Intended for use in side-argument specification—the same places where
AsSingleton and AsIter are used, but returns an interface that allows
key lookup.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pcoll</strong> – Input pcollection. All elements should be key-value pairs (i.e.
2-tuples) with unique keys.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>An AsDict-wrapper around a PCollection whose one element is a dict with</dt><dd><p>entries for uniquely-keyed pairs in pcoll.</p>
</dd>
</dl>
</p>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsMultiMap">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">AsMultiMap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsMultiMap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsMultiMap" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#apache_beam.pvalue.AsSideInput" title="apache_beam.pvalue.AsSideInput"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsSideInput</span></code></a></p>
<p>Marker specifying a PCollection to be used as an indexable side input.</p>
<p>Similar to AsDict, but multiple values may be associated per key, and
the keys are fetched lazily rather than all having to fit in memory.</p>
<p>Intended for use in side-argument specification—the same places where
AsSingleton and AsIter are used, but returns an interface that allows
key lookup.</p>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.AsMultiMap.requires_keyed_input">
<span class="sig-name descname"><span class="pre">requires_keyed_input</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#AsMultiMap.requires_keyed_input"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.AsMultiMap.requires_keyed_input" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.EmptySideInput">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">EmptySideInput</span></span><a class="reference internal" href="_modules/apache_beam/pvalue.html#EmptySideInput"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.EmptySideInput" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Value indicating when a singleton side input was empty.</p>
<p>If a PCollection was furnished as a singleton side input to a PTransform, and
that PCollection was empty, then this value is supplied to the DoFn in the
place where a value from a non-empty PCollection would have gone. This alerts
the DoFn that the side input PCollection was empty. Users may want to check
whether side input values are EmptySideInput, but they will very likely never
want to create new instances of this class themselves.</p>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.pvalue.Row">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.pvalue.</span></span><span class="sig-name descname"><span class="pre">Row</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#Row"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.Row" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A dynamic schema’d row object.</p>
<p>This objects attributes are initialized from the keywords passed into its
constructor, e.g. Row(x=3, y=4) will create a Row with two attributes x and y.</p>
<p>More importantly, when a Row object is returned from a <cite>Map</cite>, <cite>FlatMap</cite>, or
<cite>DoFn</cite> type inference is able to deduce the schema of the resulting
PCollection, e.g.</p>
<blockquote>
<div><p>pc | beam.Map(lambda x: Row(x=x, y=0.5 * x))</p>
</div></blockquote>
<p>when applied to a PCollection of ints will produce a PCollection with schema
<cite>(x=int, y=float)</cite>.</p>
<p>Note that in Beam 2.30.0 and later, Row objects are sensitive to field order.
So <cite>Row(x=3, y=4)</cite> is not considered equal to <cite>Row(y=4, x=3)</cite>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.pvalue.Row.as_dict">
<span class="sig-name descname"><span class="pre">as_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/pvalue.html#Row.as_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.pvalue.Row.as_dict" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="apache_beam.pipeline.html" class="btn btn-neutral float-left" title="apache_beam.pipeline module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright %Y, Apache Beam.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>