| |
| |
| <!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.transforms.enrichment module — 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="next" title="apache_beam.transforms.environments module" href="apache_beam.transforms.environments.html" /> |
| <link rel="prev" title="apache_beam.transforms.display module" href="apache_beam.transforms.display.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 class="current"> |
| <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 current"><a class="reference internal" href="apache_beam.transforms.html">apache_beam.transforms package</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="apache_beam.transforms.html#subpackages">Subpackages</a></li> |
| <li class="toctree-l2 current"><a class="reference internal" href="apache_beam.transforms.html#submodules">Submodules</a><ul class="current"> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.async_dofn.html">apache_beam.transforms.async_dofn module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.combinefn_lifecycle_pipeline.html">apache_beam.transforms.combinefn_lifecycle_pipeline module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.combiners.html">apache_beam.transforms.combiners module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.core.html">apache_beam.transforms.core module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.create_source.html">apache_beam.transforms.create_source module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.deduplicate.html">apache_beam.transforms.deduplicate module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.display.html">apache_beam.transforms.display module</a></li> |
| <li class="toctree-l3 current"><a class="current reference internal" href="#">apache_beam.transforms.enrichment module</a><ul> |
| <li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.enrichment.EnrichmentSourceHandler"><code class="docutils literal notranslate"><span class="pre">EnrichmentSourceHandler</span></code></a></li> |
| <li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.enrichment.Enrichment"><code class="docutils literal notranslate"><span class="pre">Enrichment</span></code></a></li> |
| <li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.enrichment.cross_join"><code class="docutils literal notranslate"><span class="pre">cross_join()</span></code></a></li> |
| </ul> |
| </li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.environments.html">apache_beam.transforms.environments module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.error_handling.html">apache_beam.transforms.error_handling module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external.html">apache_beam.transforms.external module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_java.html">apache_beam.transforms.external_java module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_transform_provider.html">apache_beam.transforms.external_transform_provider module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.fully_qualified_named_transform.html">apache_beam.transforms.fully_qualified_named_transform module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.managed.html">apache_beam.transforms.managed module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.periodicsequence.html">apache_beam.transforms.periodicsequence module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.ptransform.html">apache_beam.transforms.ptransform module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.resources.html">apache_beam.transforms.resources module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.sideinputs.html">apache_beam.transforms.sideinputs module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.sql.html">apache_beam.transforms.sql module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.stats.html">apache_beam.transforms.stats module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.timeutil.html">apache_beam.transforms.timeutil module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.trigger.html">apache_beam.transforms.trigger module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.userstate.html">apache_beam.transforms.userstate module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.util.html">apache_beam.transforms.util module</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.window.html">apache_beam.transforms.window module</a></li> |
| </ul> |
| </li> |
| </ul> |
| </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> |
| <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"><a class="reference internal" href="apache_beam.pvalue.html">apache_beam.pvalue module</a></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"><a href="apache_beam.transforms.html">apache_beam.transforms package</a></li> |
| <li class="breadcrumb-item active">apache_beam.transforms.enrichment module</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="_sources/apache_beam.transforms.enrichment.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.transforms.enrichment"> |
| <span id="apache-beam-transforms-enrichment-module"></span><h1>apache_beam.transforms.enrichment module<a class="headerlink" href="#module-apache_beam.transforms.enrichment" title="Link to this heading"></a></h1> |
| <dl class="py class"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment.EnrichmentSourceHandler"> |
| <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.enrichment.</span></span><span class="sig-name descname"><span class="pre">EnrichmentSourceHandler</span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment.html#EnrichmentSourceHandler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment.EnrichmentSourceHandler" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Caller</span></code>[<code class="xref py py-obj docutils literal notranslate"><span class="pre">InputT</span></code>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">OutputT</span></code>]</p> |
| <p>Wrapper class for <cite>apache_beam.io.requestresponse.Caller</cite>.</p> |
| <p>Ensure that the implementation of <code class="docutils literal notranslate"><span class="pre">__call__</span></code> method returns a tuple |
| of <cite>beam.Row</cite> objects.</p> |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment.EnrichmentSourceHandler.get_cache_key"> |
| <span class="sig-name descname"><span class="pre">get_cache_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">InputT</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><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></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment.html#EnrichmentSourceHandler.get_cache_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment.EnrichmentSourceHandler.get_cache_key" title="Link to this definition"></a></dt> |
| <dd><p>Returns the request to be cached. This is how the response will be |
| looked up in the cache as well.</p> |
| <p>Implement this method to provide the key for the cache. |
| By default, the entire request is stored as the cache key.</p> |
| <p>For example, in <cite>BigTableEnrichmentHandler</cite>, the row key for the element |
| is returned here.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment.Enrichment"> |
| <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.enrichment.</span></span><span class="sig-name descname"><span class="pre">Enrichment</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">source_handler:</span> <span class="pre">~apache_beam.transforms.enrichment.EnrichmentSourceHandler,</span> <span class="pre">join_fn:</span> <span class="pre">~collections.abc.Callable[[dict[str,</span> <span class="pre">~typing.Any],</span> <span class="pre">dict[str,</span> <span class="pre">~typing.Any]],</span> <span class="pre">~apache_beam.pvalue.Row]</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre">None,</span> <span class="pre">timeout:</span> <span class="pre">float</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre">30,</span> <span class="pre">repeater:</span> <span class="pre">~apache_beam.io.requestresponse.Repeater</span> <span class="pre">=</span> <span class="pre"><apache_beam.io.requestresponse.ExponentialBackOffRepeater</span> <span class="pre">object>,</span> <span class="pre">throttler:</span> <span class="pre">~apache_beam.io.requestresponse.PreCallThrottler</span> <span class="pre">=</span> <span class="pre"><apache_beam.io.requestresponse.DefaultThrottler</span> <span class="pre">object>,</span> <span class="pre">use_custom_types:</span> <span class="pre">bool</span> <span class="pre">=</span> <span class="pre">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment.html#Enrichment"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment.Enrichment" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">PTransform</span></code></a>[<a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">PCollection</span></code></a>[<code class="xref py py-obj docutils literal notranslate"><span class="pre">InputT</span></code>], <a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">PCollection</span></code></a>[<code class="xref py py-obj docutils literal notranslate"><span class="pre">OutputT</span></code>]]</p> |
| <p>A <a class="reference internal" href="#apache_beam.transforms.enrichment.Enrichment" title="apache_beam.transforms.enrichment.Enrichment"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.enrichment.Enrichment</span></code></a> transform to |
| enrich elements in a PCollection.</p> |
| <p>Uses the <a class="reference internal" href="#apache_beam.transforms.enrichment.EnrichmentSourceHandler" title="apache_beam.transforms.enrichment.EnrichmentSourceHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.enrichment.EnrichmentSourceHandler</span></code></a> |
| to enrich elements by joining the metadata from external source.</p> |
| <p>Processes an input <a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">PCollection</span></code></a> of <cite>beam.Row</cite> by |
| applying a <a class="reference internal" href="#apache_beam.transforms.enrichment.EnrichmentSourceHandler" title="apache_beam.transforms.enrichment.EnrichmentSourceHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.enrichment.EnrichmentSourceHandler</span></code></a> |
| to each element and returning the enriched |
| <a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">PCollection</span></code></a>.</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>source_handler</strong> – Handles source lookup and metadata retrieval. |
| Implements the |
| <a class="reference internal" href="#apache_beam.transforms.enrichment.EnrichmentSourceHandler" title="apache_beam.transforms.enrichment.EnrichmentSourceHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.enrichment.EnrichmentSourceHandler</span></code></a></p></li> |
| <li><p><strong>join_fn</strong> – A lambda function to join original element with lookup metadata. |
| Defaults to <cite>CROSS_JOIN</cite>.</p></li> |
| <li><p><strong>timeout</strong> – (Optional) timeout for source requests. Defaults to 30 seconds.</p></li> |
| <li><p><strong>repeater</strong> – provides method to repeat failed requests to API due to service |
| errors. Defaults to |
| <a class="reference internal" href="apache_beam.io.requestresponse.html#apache_beam.io.requestresponse.ExponentialBackOffRepeater" title="apache_beam.io.requestresponse.ExponentialBackOffRepeater"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.io.requestresponse.ExponentialBackOffRepeater</span></code></a> to |
| repeat requests with exponential backoff.</p></li> |
| <li><p><strong>throttler</strong> – provides methods to pre-throttle a request. Defaults to |
| <a class="reference internal" href="apache_beam.io.requestresponse.html#apache_beam.io.requestresponse.DefaultThrottler" title="apache_beam.io.requestresponse.DefaultThrottler"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.io.requestresponse.DefaultThrottler</span></code></a> for |
| client-side adaptive throttling using |
| <a class="reference internal" href="apache_beam.io.components.adaptive_throttler.html#apache_beam.io.components.adaptive_throttler.AdaptiveThrottler" title="apache_beam.io.components.adaptive_throttler.AdaptiveThrottler"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.io.components.adaptive_throttler.AdaptiveThrottler</span></code></a>.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment.Enrichment.expand"> |
| <span class="sig-name descname"><span class="pre">expand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_row</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.html#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a><span class="p"><span class="pre">[</span></span><span class="pre">InputT</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.PCollection" title="apache_beam.pvalue.PCollection"><span class="pre">PCollection</span></a><span class="p"><span class="pre">[</span></span><span class="pre">OutputT</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment.html#Enrichment.expand"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment.Enrichment.expand" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment.Enrichment.with_redis_cache"> |
| <span class="sig-name descname"><span class="pre">with_redis_cache</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">host</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">port</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#int" title="(in Python v3.13)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">time_to_live</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#int" title="(in Python v3.13)"><span class="pre">int</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/datetime.html#datetime.timedelta" title="(in Python v3.13)"><span class="pre">timedelta</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">86400</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_coder</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.coders.coders.html#apache_beam.coders.coders.Coder" title="apache_beam.coders.coders.Coder"><span class="pre">Coder</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">response_coder</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="apache_beam.coders.coders.html#apache_beam.coders.coders.Coder" title="apache_beam.coders.coders.Coder"><span class="pre">Coder</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="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/transforms/enrichment.html#Enrichment.with_redis_cache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment.Enrichment.with_redis_cache" title="Link to this definition"></a></dt> |
| <dd><p>Configure the Redis cache to use with enrichment transform.</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>host</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The hostname or IP address of the Redis server.</p></li> |
| <li><p><strong>port</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a>) – The port number of the Redis server.</p></li> |
| <li><p><strong>time_to_live</strong> – <cite>(Union[int, timedelta])</cite> The time-to-live (TTL) for |
| records stored in Redis. Provide an integer (in seconds) or a |
| <cite>datetime.timedelta</cite> object.</p></li> |
| <li><p><strong>request_coder</strong> – (Optional[<cite>coders.Coder</cite>]) coder for requests stored |
| in Redis.</p></li> |
| <li><p><strong>response_coder</strong> – (Optional[<cite>coders.Coder</cite>]) coder for decoding responses |
| received from Redis.</p></li> |
| <li><p><strong>kwargs</strong> – Optional additional keyword arguments that |
| are required to connect to your redis server. Same as <cite>redis.Redis()</cite>.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py function"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment.cross_join"> |
| <span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.enrichment.</span></span><span class="sig-name descname"><span class="pre">cross_join</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">left</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#dict" title="(in Python v3.13)"><span class="pre">dict</span></a><span class="p"><span class="pre">[</span></span><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="p"><span class="pre">,</span></span><span class="w"> </span><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 class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">right</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#dict" title="(in Python v3.13)"><span class="pre">dict</span></a><span class="p"><span class="pre">[</span></span><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="p"><span class="pre">,</span></span><span class="w"> </span><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 class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.Row" title="apache_beam.pvalue.Row"><span class="pre">Row</span></a></span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment.html#cross_join"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment.cross_join" title="Link to this definition"></a></dt> |
| <dd><p>performs a cross join on two <cite>dict</cite> objects.</p> |
| <p>Joins the columns of the right row onto the left row.</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>left</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)"><em>dict</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a><em>, </em><em>Any</em><em>]</em>) – input request dictionary.</p></li> |
| <li><p><strong>right</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)"><em>dict</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a><em>, </em><em>Any</em><em>]</em>) – response dictionary from the API.</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns<span class="colon">:</span></dt> |
| <dd class="field-even"><p><cite>beam.Row</cite> containing the merged columns.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </section> |
| |
| |
| </div> |
| </div> |
| <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| <a href="apache_beam.transforms.display.html" class="btn btn-neutral float-left" title="apache_beam.transforms.display module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| <a href="apache_beam.transforms.environments.html" class="btn btn-neutral float-right" title="apache_beam.transforms.environments module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> |
| </div> |
| |
| <hr/> |
| |
| <div role="contentinfo"> |
| <p>© 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> |