| |
| |
| <!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_handlers.bigtable module — Apache Beam 2.67.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=959b4fbe"></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.enrichment_handlers.feast_feature_store module" href="apache_beam.transforms.enrichment_handlers.feast_feature_store.html" /> |
| <link rel="prev" title="apache_beam.transforms.enrichment_handlers.bigquery module" href="apache_beam.transforms.enrichment_handlers.bigquery.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 current"><a class="reference internal" href="apache_beam.transforms.html#subpackages">Subpackages</a><ul class="current"> |
| <li class="toctree-l3 current"><a class="reference internal" href="apache_beam.transforms.enrichment_handlers.html">apache_beam.transforms.enrichment_handlers package</a><ul class="current"> |
| <li class="toctree-l4 current"><a class="reference internal" href="apache_beam.transforms.enrichment_handlers.html#submodules">Submodules</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.xlang.html">apache_beam.transforms.xlang package</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="apache_beam.transforms.html#submodules">Submodules</a></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"><a href="apache_beam.transforms.enrichment_handlers.html">apache_beam.transforms.enrichment_handlers package</a></li> |
| <li class="breadcrumb-item active">apache_beam.transforms.enrichment_handlers.bigtable module</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="_sources/apache_beam.transforms.enrichment_handlers.bigtable.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_handlers.bigtable"> |
| <span id="apache-beam-transforms-enrichment-handlers-bigtable-module"></span><h1>apache_beam.transforms.enrichment_handlers.bigtable module<a class="headerlink" href="#module-apache_beam.transforms.enrichment_handlers.bigtable" title="Link to this heading"></a></h1> |
| <dl class="py class"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler"> |
| <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_handlers.bigtable.</span></span><span class="sig-name descname"><span class="pre">BigTableEnrichmentHandler</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">project_id:</span> <span class="pre">str,</span> <span class="pre">instance_id:</span> <span class="pre">str,</span> <span class="pre">table_id:</span> <span class="pre">str,</span> <span class="pre">row_key:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre">'',</span> <span class="pre">row_filter:</span> <span class="pre">~google.cloud.bigtable.row_filters.RowFilter</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre"><google.cloud.bigtable.row_filters.CellsColumnLimitFilter</span> <span class="pre">object>,</span> <span class="pre">*,</span> <span class="pre">app_profile_id:</span> <span class="pre">str</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre">None,</span> <span class="pre">encoding:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre">'utf-8',</span> <span class="pre">row_key_fn:</span> <span class="pre">~collections.abc.Callable[[~apache_beam.pvalue.Row],</span> <span class="pre">bytes]</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre">None,</span> <span class="pre">exception_level:</span> <span class="pre">~apache_beam.transforms.enrichment_handlers.utils.ExceptionLevel</span> <span class="pre">=</span> <span class="pre">ExceptionLevel.WARN,</span> <span class="pre">include_timestamp:</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_handlers/bigtable.html#BigTableEnrichmentHandler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.enrichment.html#apache_beam.transforms.enrichment.EnrichmentSourceHandler" title="apache_beam.transforms.enrichment.EnrichmentSourceHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">EnrichmentSourceHandler</span></code></a>[<a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.Row" title="apache_beam.pvalue.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>, <a class="reference internal" href="apache_beam.pvalue.html#apache_beam.pvalue.Row" title="apache_beam.pvalue.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>]</p> |
| <p>A handler for <a class="reference internal" href="apache_beam.transforms.enrichment.html#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 interact with GCP BigTable.</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>project_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – GCP project-id of the BigTable cluster.</p></li> |
| <li><p><strong>instance_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – GCP instance-id of the BigTable cluster.</p></li> |
| <li><p><strong>table_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – GCP table-id of the BigTable.</p></li> |
| <li><p><strong>row_key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – unique row-key field name from the input <cite>beam.Row</cite> object |
| to use as <cite>row_key</cite> for BigTable querying.</p></li> |
| <li><p><strong>row_filter</strong> – a <code class="docutils literal notranslate"><span class="pre">:class:`google.cloud.bigtable.row_filters.RowFilter`</span></code> to |
| filter data read with <code class="docutils literal notranslate"><span class="pre">read_row()</span></code>. |
| Defaults to <cite>CellsColumnLimitFilter(1)</cite>.</p></li> |
| <li><p><strong>app_profile_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – App profile ID to use for BigTable. |
| See <a class="reference external" href="https://cloud.google.com/bigtable/docs/app-profiles">https://cloud.google.com/bigtable/docs/app-profiles</a> for more details.</p></li> |
| <li><p><strong>encoding</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – encoding type to convert the string to bytes and vice-versa |
| from BigTable. Default is <cite>utf-8</cite>.</p></li> |
| <li><p><strong>row_key_fn</strong> – a lambda function that returns a string row key from the |
| input row. It is used to build/extract the row key for Bigtable.</p></li> |
| <li><p><strong>exception_level</strong> – a <cite>enum.Enum</cite> value from |
| <code class="docutils literal notranslate"><span class="pre">apache_beam.transforms.enrichment_handlers.utils.ExceptionLevel</span></code> |
| to set the level when an empty row is returned from the BigTable query. |
| Defaults to <code class="docutils literal notranslate"><span class="pre">ExceptionLevel.WARN</span></code>.</p></li> |
| <li><p><strong>include_timestamp</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.13)"><em>bool</em></a>) – If enabled, the timestamp associated with the |
| value is returned as <cite>(value, timestamp)</cite> for each <cite>row_key</cite>. |
| Defaults to <cite>False</cite> - only the latest value without |
| the timestamp is returned.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler.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"><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></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_handlers/bigtable.html#BigTableEnrichmentHandler.get_cache_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler.get_cache_key" title="Link to this definition"></a></dt> |
| <dd><p>Returns a string formatted with row key since it is unique to |
| a request made to <cite>Bigtable</cite>.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| </section> |
| |
| |
| </div> |
| </div> |
| <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| <a href="apache_beam.transforms.enrichment_handlers.bigquery.html" class="btn btn-neutral float-left" title="apache_beam.transforms.enrichment_handlers.bigquery module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| <a href="apache_beam.transforms.enrichment_handlers.feast_feature_store.html" class="btn btn-neutral float-right" title="apache_beam.transforms.enrichment_handlers.feast_feature_store 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> |