| |
| |
| <!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.cloudsql 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.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.bigtable module" href="apache_beam.transforms.enrichment_handlers.bigtable.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.cloudsql module</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="_sources/apache_beam.transforms.enrichment_handlers.cloudsql.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.cloudsql"> |
| <span id="apache-beam-transforms-enrichment-handlers-cloudsql-module"></span><h1>apache_beam.transforms.enrichment_handlers.cloudsql module<a class="headerlink" href="#module-apache_beam.transforms.enrichment_handlers.cloudsql" title="Link to this heading"></a></h1> |
| <dl class="py class"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CustomQueryConfig"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">CustomQueryConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query_fn</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/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><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 class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </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></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#CustomQueryConfig"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CustomQueryConfig" 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>Configuration for using a custom query function.</p> |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CustomQueryConfig.query_fn"> |
| <span class="sig-name descname"><span class="pre">query_fn</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><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 class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CustomQueryConfig.query_fn" 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.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">TableFieldsQueryConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">table_id</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">where_clause_template</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">where_clause_fields</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.List" title="(in Python v3.13)"><span class="pre">List</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></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#TableFieldsQueryConfig"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig" 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>Configuration for using table name, where clause, and field names.</p> |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig.table_id"> |
| <span class="sig-name descname"><span class="pre">table_id</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig.table_id" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig.where_clause_template"> |
| <span class="sig-name descname"><span class="pre">where_clause_template</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig.where_clause_template" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig.where_clause_fields"> |
| <span class="sig-name descname"><span class="pre">where_clause_fields</span></span><em class="property"><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.List" title="(in Python v3.13)"><span class="pre">List</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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig.where_clause_fields" 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.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">TableFunctionQueryConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">table_id</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">where_clause_template</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">where_clause_value_fn</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/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><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 class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><span class="pre">list</span></a><span class="p"><span class="pre">[</span></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 class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#TableFunctionQueryConfig"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig" 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>Configuration for using table name, where clause, and a value function.</p> |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig.table_id"> |
| <span class="sig-name descname"><span class="pre">table_id</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig.table_id" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig.where_clause_template"> |
| <span class="sig-name descname"><span class="pre">where_clause_template</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig.where_clause_template" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig.where_clause_value_fn"> |
| <span class="sig-name descname"><span class="pre">where_clause_value_fn</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><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 class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><span class="pre">list</span></a><span class="p"><span class="pre">[</span></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 class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig.where_clause_value_fn" 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.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">DatabaseTypeAdapter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#DatabaseTypeAdapter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.Enum" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a></p> |
| <p>An enumeration.</p> |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.POSTGRESQL"> |
| <span class="sig-name descname"><span class="pre">POSTGRESQL</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'pg8000'</span></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.POSTGRESQL" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.MYSQL"> |
| <span class="sig-name descname"><span class="pre">MYSQL</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'pymysql'</span></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.MYSQL" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.SQLSERVER"> |
| <span class="sig-name descname"><span class="pre">SQLSERVER</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'pytds'</span></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.SQLSERVER" 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_handlers.cloudsql.DatabaseTypeAdapter.to_sqlalchemy_dialect"> |
| <span class="sig-name descname"><span class="pre">to_sqlalchemy_dialect</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#DatabaseTypeAdapter.to_sqlalchemy_dialect"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter.to_sqlalchemy_dialect" title="Link to this definition"></a></dt> |
| <dd><p>Map the adapter type to its corresponding SQLAlchemy dialect.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Returns<span class="colon">:</span></dt> |
| <dd class="field-odd"><p>SQLAlchemy dialect string.</p> |
| </dd> |
| <dt class="field-even">Return type<span class="colon">:</span></dt> |
| <dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">ConnectionConfig</span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#ConnectionConfig"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/abc.html#abc.ABC" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ABC</span></code></a></p> |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig.get_connector_handler"> |
| <em class="property"><span class="pre">abstract</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">get_connector_handler</span></span><span class="sig-paren">(</span><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/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Connection</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#ConnectionConfig.get_connector_handler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig.get_connector_handler" 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_handlers.cloudsql.ConnectionConfig.get_db_url"> |
| <em class="property"><span class="pre">abstract</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">get_db_url</span></span><span class="sig-paren">(</span><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/cloudsql.html#ConnectionConfig.get_db_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig.get_db_url" 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.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">CloudSQLConnectionConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">db_adapter:</span> <span class="pre">~apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">instance_connection_uri:</span> <span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">user:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_id:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">refresh_strategy:</span> <span class="pre">~google.cloud.sql.connector.enums.RefreshStrategy</span> <span class="pre">=</span> <span class="pre">RefreshStrategy.LAZY</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">connector_kwargs:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Any]</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">connect_kwargs:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Any]</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#CloudSQLConnectionConfig"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <a class="reference internal" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConnectionConfig</span></code></a></p> |
| <p>Connects to Google Cloud SQL using Cloud SQL Python Connector.</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>db_adapter</strong> – The database adapter type (PostgreSQL, MySQL, SQL Server).</p></li> |
| <li><p><strong>instance_connection_uri</strong> – URI for connecting to the Cloud SQL instance.</p></li> |
| <li><p><strong>user</strong> – Username for authentication.</p></li> |
| <li><p><strong>password</strong> – Password for authentication. Defaults to None.</p></li> |
| <li><p><strong>db_id</strong> – Database identifier/name.</p></li> |
| <li><p><strong>refresh_strategy</strong> – Strategy for refreshing connection (default: LAZY).</p></li> |
| <li><p><strong>connector_kwargs</strong> – Additional keyword arguments for the |
| Cloud SQL Python Connector. Enables forward compatibility.</p></li> |
| <li><p><strong>connect_kwargs</strong> – Additional keyword arguments for the client connect |
| method. Enables forward compatibility.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.db_adapter"> |
| <span class="sig-name descname"><span class="pre">db_adapter</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.enrichment_handlers.cloudsql.DatabaseTypeAdapter" title="apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter"><span class="pre">DatabaseTypeAdapter</span></a></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.db_adapter" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.instance_connection_uri"> |
| <span class="sig-name descname"><span class="pre">instance_connection_uri</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.instance_connection_uri" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.user"> |
| <span class="sig-name descname"><span class="pre">user</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.user" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.password"> |
| <span class="sig-name descname"><span class="pre">password</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.password" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.db_id"> |
| <span class="sig-name descname"><span class="pre">db_id</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.db_id" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.refresh_strategy"> |
| <span class="sig-name descname"><span class="pre">refresh_strategy</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">RefreshStrategy</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'LAZY'</span></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.refresh_strategy" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.connector_kwargs"> |
| <span class="sig-name descname"><span class="pre">connector_kwargs</span></span><em class="property"><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.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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.connector_kwargs" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.connect_kwargs"> |
| <span class="sig-name descname"><span class="pre">connect_kwargs</span></span><em class="property"><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.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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.connect_kwargs" 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_handlers.cloudsql.CloudSQLConnectionConfig.get_connector_handler"> |
| <span class="sig-name descname"><span class="pre">get_connector_handler</span></span><span class="sig-paren">(</span><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/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Connection</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#CloudSQLConnectionConfig.get_connector_handler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.get_connector_handler" title="Link to this definition"></a></dt> |
| <dd><p>Returns a function that creates a new database connection.</p> |
| <p>The returned connector function creates database connections that should |
| be properly closed by the caller when no longer needed.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.get_db_url"> |
| <span class="sig-name descname"><span class="pre">get_db_url</span></span><span class="sig-paren">(</span><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/cloudsql.html#CloudSQLConnectionConfig.get_db_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLConnectionConfig.get_db_url" 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.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">ExternalSQLDBConnectionConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">db_adapter:</span> <span class="pre">~apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">host:</span> <span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port:</span> <span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">user:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_id:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">connect_kwargs:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Any]</span> <span class="pre">=</span> <span class="pre"><factory></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#ExternalSQLDBConnectionConfig"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig" title="Link to this definition"></a></dt> |
| <dd><p>Bases: <a class="reference internal" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConnectionConfig</span></code></a></p> |
| <p>Connects to External SQL DBs (PostgreSQL, MySQL, SQL Server) over TCP.</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>db_adapter</strong> – The database adapter type (PostgreSQL, MySQL, SQL Server).</p></li> |
| <li><p><strong>host</strong> – Hostname or IP address of the database server.</p></li> |
| <li><p><strong>port</strong> – Port number for the database connection.</p></li> |
| <li><p><strong>user</strong> – Username for authentication.</p></li> |
| <li><p><strong>password</strong> – Password for authentication.</p></li> |
| <li><p><strong>db_id</strong> – Database identifier/name.</p></li> |
| <li><p><strong>connect_kwargs</strong> – Additional keyword arguments for the client connect |
| method. Enables forward compatibility.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.db_adapter"> |
| <span class="sig-name descname"><span class="pre">db_adapter</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.enrichment_handlers.cloudsql.DatabaseTypeAdapter" title="apache_beam.transforms.enrichment_handlers.cloudsql.DatabaseTypeAdapter"><span class="pre">DatabaseTypeAdapter</span></a></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.db_adapter" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.host"> |
| <span class="sig-name descname"><span class="pre">host</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.host" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.port"> |
| <span class="sig-name descname"><span class="pre">port</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.port" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.user"> |
| <span class="sig-name descname"><span class="pre">user</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.user" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.password"> |
| <span class="sig-name descname"><span class="pre">password</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.password" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.db_id"> |
| <span class="sig-name descname"><span class="pre">db_id</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.db_id" title="Link to this definition"></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py attribute"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.connect_kwargs"> |
| <span class="sig-name descname"><span class="pre">connect_kwargs</span></span><em class="property"><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.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></em><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.connect_kwargs" 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_handlers.cloudsql.ExternalSQLDBConnectionConfig.get_connector_handler"> |
| <span class="sig-name descname"><span class="pre">get_connector_handler</span></span><span class="sig-paren">(</span><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/collections.abc.html#collections.abc.Callable" title="(in Python v3.13)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Connection</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#ExternalSQLDBConnectionConfig.get_connector_handler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.get_connector_handler" title="Link to this definition"></a></dt> |
| <dd><p>Returns a function that creates a new database connection.</p> |
| <p>The returned connector function creates database connections that should |
| be properly closed by the caller when no longer needed.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.get_db_url"> |
| <span class="sig-name descname"><span class="pre">get_db_url</span></span><span class="sig-paren">(</span><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/cloudsql.html#ExternalSQLDBConnectionConfig.get_db_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ExternalSQLDBConnectionConfig.get_db_url" 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.transforms.enrichment_handlers.cloudsql.CloudSQLEnrichmentHandler"> |
| <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.cloudsql.</span></span><span class="sig-name descname"><span class="pre">CloudSQLEnrichmentHandler</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_config</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.enrichment_handlers.cloudsql.ConnectionConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig"><span class="pre">ConnectionConfig</span></a></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">query_config</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.enrichment_handlers.cloudsql.CustomQueryConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.CustomQueryConfig"><span class="pre">CustomQueryConfig</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.TableFieldsQueryConfig"><span class="pre">TableFieldsQueryConfig</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.TableFunctionQueryConfig"><span class="pre">TableFunctionQueryConfig</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">column_names</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#list" title="(in Python v3.13)"><span class="pre">list</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><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">min_batch_size</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><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_batch_size</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><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">10000</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_handlers/cloudsql.html#CloudSQLEnrichmentHandler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLEnrichmentHandler" 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>Enrichment handler for Cloud SQL databases.</p> |
| <p>This handler is designed to work with the |
| <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.</p> |
| <dl class="simple"> |
| <dt>To use this handler, you need to provide one of the following query configs:</dt><dd><ul class="simple"> |
| <li><p>CustomQueryConfig - For providing a custom query function</p></li> |
| <li><p>TableFieldsQueryConfig - For specifying table, where clause, and fields</p></li> |
| <li><p>TableFunctionQueryConfig - For specifying table, where clause, and val fn</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <p>By default, the handler retrieves all columns from the specified table. |
| To limit the columns, use the <cite>column_names</cite> parameter to specify |
| the desired column names.</p> |
| <p>This handler queries the Cloud SQL database per element by default. |
| To enable batching, set the <cite>min_batch_size</cite> and <cite>max_batch_size</cite> parameters. |
| These values control the batching behavior in the |
| <code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.utils.BatchElements</span></code> transform.</p> |
| <p>NOTE: Batching is not supported when using the CustomQueryConfig.</p> |
| <p>Example usage:</p> |
| <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">connection_config</span> <span class="o">=</span> <span class="n">CloudSQLConnectionConfig</span><span class="p">(</span> |
| <span class="n">db_adapter</span><span class="o">=</span><span class="n">DatabaseTypeAdapter</span><span class="o">.</span><span class="n">POSTGRESQL</span><span class="p">,</span> |
| <span class="n">instance_connection_uri</span><span class="o">=</span><span class="s2">"apache-beam-testing:us-central1:itests"</span><span class="p">,</span> |
| <span class="n">user</span><span class="o">=</span><span class="s1">'postgres'</span><span class="p">,</span> |
| <span class="n">password</span><span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s2">"CLOUDSQL_PG_PASSWORD"</span><span class="p">))</span> |
| <span class="n">query_config</span><span class="o">=</span><span class="n">TableFieldsQueryConfig</span><span class="p">(</span><span class="s1">'my_table'</span><span class="p">,</span><span class="s2">"id = :param0"</span><span class="p">,[</span><span class="s1">'id'</span><span class="p">]),</span> |
| <span class="n">cloudsql_handler</span> <span class="o">=</span> <span class="n">CloudSQLEnrichmentHandler</span><span class="p">(</span> |
| <span class="n">connection_config</span><span class="o">=</span><span class="n">connection_config</span><span class="p">,</span> |
| <span class="n">query_config</span><span class="o">=</span><span class="n">query_config</span><span class="p">,</span> |
| <span class="n">min_batch_size</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> |
| <span class="n">max_batch_size</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span> |
| </pre></div> |
| </div> |
| <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>connection_config</strong> (<a class="reference internal" href="#apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig" title="apache_beam.transforms.enrichment_handlers.cloudsql.ConnectionConfig"><em>ConnectionConfig</em></a>) – Configuration for connecting to |
| the SQL database. Must be an instance of a subclass of |
| <cite>ConnectionConfig</cite>, such as <cite>CloudSQLConnectionConfig</cite> or |
| <cite>ExternalSQLDBConnectionConfig</cite>. This determines how the handler |
| connects to the target SQL database.</p></li> |
| <li><p><strong>query_config</strong> – Configuration for database queries. Must be one of:</p></li> |
| <li><p><strong>CustomQueryConfig</strong> (<em>*</em>) – For providing a custom query function</p></li> |
| <li><p><strong>TableFieldsQueryConfig</strong> (<em>*</em>) – specifies table, where clause, and field names</p></li> |
| <li><p><strong>TableFunctionQueryConfig</strong> (<em>*</em>) – specifies table, where clause, and val func</p></li> |
| <li><p><strong>column_names</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><em>list</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>]</em>) – List of column names to select from |
| the Cloud SQL table. If not provided, all columns (<cite>*</cite>) are selected.</p></li> |
| <li><p><strong>min_batch_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a>) – Minimum number of rows to batch together when |
| querying the database. Defaults to 1 if <cite>query_fn</cite> is not used.</p></li> |
| <li><p><strong>max_batch_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a>) – Maximum number of rows to batch together. Defaults |
| to 10,000 if <cite>query_fn</cite> is not used.</p></li> |
| <li><p><strong>**kwargs</strong> – Additional keyword arguments for database connection or query |
| handling.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <ul class="simple"> |
| <li><p>Cannot use <cite>min_batch_size</cite> or <cite>max_batch_size</cite> with <cite>query_fn</cite>.</p></li> |
| <li><p>Either <cite>where_clause_fields</cite> or <cite>where_clause_value_fn</cite> must be provided |
| for query construction if <cite>query_fn</cite> is not provided.</p></li> |
| <li><p>Ensure that the database user has the necessary permissions to query the |
| specified table.</p></li> |
| </ul> |
| </div> |
| <dl class="py method"> |
| <dt class="sig sig-object py" id="apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLEnrichmentHandler.create_row_key"> |
| <span class="sig-name descname"><span class="pre">create_row_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">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.Row" title="apache_beam.pvalue.Row"><span class="pre">Row</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#CloudSQLEnrichmentHandler.create_row_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLEnrichmentHandler.create_row_key" 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_handlers.cloudsql.CloudSQLEnrichmentHandler.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 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/stdtypes.html#list" title="(in Python v3.13)"><span class="pre">list</span></a><span class="p"><span class="pre">[</span></span><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 class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#CloudSQLEnrichmentHandler.get_cache_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLEnrichmentHandler.get_cache_key" 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_handlers.cloudsql.CloudSQLEnrichmentHandler.batch_elements_kwargs"> |
| <span class="sig-name descname"><span class="pre">batch_elements_kwargs</span></span><span class="sig-paren">(</span><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/collections.abc.html#collections.abc.Mapping" title="(in Python v3.13)"><span class="pre">Mapping</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></span><a class="reference internal" href="_modules/apache_beam/transforms/enrichment_handlers/cloudsql.html#CloudSQLEnrichmentHandler.batch_elements_kwargs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.enrichment_handlers.cloudsql.CloudSQLEnrichmentHandler.batch_elements_kwargs" title="Link to this definition"></a></dt> |
| <dd><p>Returns a kwargs suitable for <cite>beam.BatchElements</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.bigtable.html" class="btn btn-neutral float-left" title="apache_beam.transforms.enrichment_handlers.bigtable 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> |