<p dir="auto"><strong>Apache Airflow version</strong>: 2.0.1</p>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">I'm seeing the following when running migrations in Airflow using <a href="https://pypi.org/project/sqlalchemy/1.4.0/" rel="nofollow">SQLAlchmey 1.4.0</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/home/runner/.local/bin/airflow&quot;, line 8, in &lt;module&gt;
    sys.exit(main())
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/__main__.py&quot;, line 40, in main
    args.func(args)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/cli/cli_parser.py&quot;, line 48, in command
    return func(*args, **kwargs)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/cli/commands/db_command.py&quot;, line 31, in initdb
    db.initdb()
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/utils/db.py&quot;, line 549, in initdb
    upgradedb()
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/utils/db.py&quot;, line 684, in upgradedb
    command.upgrade(config, 'heads')
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/command.py&quot;, line 294, in upgrade
    script.run_env()
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py&quot;, line 490, in run_env
    util.load_python_file(self.dir, &quot;env.py&quot;)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/util/pyfiles.py&quot;, line 97, in load_python_file
    module = load_module_py(module_id, path)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/util/compat.py&quot;, line 182, in load_module_py
    spec.loader.exec_module(module)
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 728, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/env.py&quot;, line 108, in &lt;module&gt;
    run_migrations_online()
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/env.py&quot;, line 102, in run_migrations_online
    context.run_migrations()
  File &quot;&lt;string&gt;&quot;, line 8, in run_migrations
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/runtime/environment.py&quot;, line 813, in run_migrations
    self.get_context().run_migrations(**kw)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/runtime/migration.py&quot;, line 548, in run_migrations
    for step in self._migrations_fn(heads, self):
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/command.py&quot;, line 283, in upgrade
    return script._upgrade_revs(revision, rev)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py&quot;, line 365, in _upgrade_revs
    revs = list(revs)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py&quot;, line 916, in _iterate_revisions
    uppers = util.dedupe_tuple(self.get_revisions(upper))
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py&quot;, line 457, in get_revisions
    resolved_id, branch_label = self._resolve_revision_number(id_)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py&quot;, line 640, in _resolve_revision_number
    self._revision_map
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/util/langhelpers.py&quot;, line 234, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py&quot;, line 156, in _revision_map
    for revision in self._generator():
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py&quot;, line 115, in _load_revisions
    script = Script._from_filename(self, vers, file_)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py&quot;, line 904, in _from_filename
    module = util.load_python_file(dir_, filename)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/util/pyfiles.py&quot;, line 97, in load_python_file
    module = load_module_py(module_id, path)
  File &quot;/home/runner/.local/lib/python3.7/site-packages/alembic/util/compat.py&quot;, line 182, in load_module_py
    spec.loader.exec_module(module)
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 728, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/versions/82b7c48c147f_remove_can_read_permission_on_config_.py&quot;, line 28, in &lt;module&gt;
    from airflow.www.app import create_app
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/www/app.py&quot;, line 38, in &lt;module&gt;
    from airflow.www.extensions.init_views import (
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/www/extensions/init_views.py&quot;, line 29, in &lt;module&gt;
    from airflow.www.views import lazy_add_provider_discovered_options_to_connection_form
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/www/views.py&quot;, line 96, in &lt;module&gt;
    from airflow.www import auth, utils as wwwutils
  File &quot;/home/runner/.local/lib/python3.7/site-packages/airflow/www/utils.py&quot;, line 27, in &lt;module&gt;
    from flask_appbuilder.models.sqla.interface import SQLAInterface
  File &quot;/home/runner/.local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py&quot;, line 16, in &lt;module&gt;
    from sqlalchemy_utils.types.uuid import UUIDType
  File &quot;/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py&quot;, line 1, in &lt;module&gt;
    from .aggregates import aggregated  # noqa
  File &quot;/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py&quot;, line 372, in &lt;module&gt;
    from .functions.orm import get_column_key
  File &quot;/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py&quot;, line 1, in &lt;module&gt;
    from .database import (  # noqa
  File &quot;/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py&quot;, line 11, in &lt;module&gt;
    from .orm import quote
  File &quot;/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py&quot;, line 14, in &lt;module&gt;
    from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/home/runner/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py)"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/home/runner/.local/bin/airflow", line 8, in &lt;module&gt;
    sys.exit(main())
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/__main__.py", line 40, in main
    args.func(args)
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/cli/cli_parser.py", line 48, in command
    return func(*args, **kwargs)
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/cli/commands/db_command.py", line 31, in initdb
    db.initdb()
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/utils/db.py", line 549, in initdb
    upgradedb()
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/utils/db.py", line 684, in upgradedb
    command.upgrade(config, 'heads')
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/command.py", line 294, in upgrade
    script.run_env()
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py", line 490, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/util/compat.py", line 182, in load_module_py
    spec.loader.exec_module(module)
  File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
  File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/env.py", line 108, in &lt;module&gt;
    run_migrations_online()
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/env.py", line 102, in run_migrations_online
    context.run_migrations()
  File "&lt;string&gt;", line 8, in run_migrations
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/runtime/environment.py", line 813, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/runtime/migration.py", line 548, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/command.py", line 283, in upgrade
    return script._upgrade_revs(revision, rev)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py", line 365, in _upgrade_revs
    revs = list(revs)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py", line 916, in _iterate_revisions
    uppers = util.dedupe_tuple(self.get_revisions(upper))
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py", line 457, in get_revisions
    resolved_id, branch_label = self._resolve_revision_number(id_)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py", line 640, in _resolve_revision_number
    self._revision_map
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/util/langhelpers.py", line 234, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/revision.py", line 156, in _revision_map
    for revision in self._generator():
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py", line 115, in _load_revisions
    script = Script._from_filename(self, vers, file_)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/script/base.py", line 904, in _from_filename
    module = util.load_python_file(dir_, filename)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/runner/.local/lib/python3.7/site-packages/alembic/util/compat.py", line 182, in load_module_py
    spec.loader.exec_module(module)
  File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
  File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/versions/82b7c48c147f_remove_can_read_permission_on_config_.py", line 28, in &lt;module&gt;
    from airflow.www.app import create_app
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/www/app.py", line 38, in &lt;module&gt;
    from airflow.www.extensions.init_views import (
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/www/extensions/init_views.py", line 29, in &lt;module&gt;
    from airflow.www.views import lazy_add_provider_discovered_options_to_connection_form
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/www/views.py", line 96, in &lt;module&gt;
    from airflow.www import auth, utils as wwwutils
  File "/home/runner/.local/lib/python3.7/site-packages/airflow/www/utils.py", line 27, in &lt;module&gt;
    from flask_appbuilder.models.sqla.interface import SQLAInterface
  File "/home/runner/.local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py", line 16, in &lt;module&gt;
    from sqlalchemy_utils.types.uuid import UUIDType
  File "/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", line 1, in &lt;module&gt;
    from .aggregates import aggregated  # noqa
  File "/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in &lt;module&gt;
    from .functions.orm import get_column_key
  File "/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in &lt;module&gt;
    from .database import (  # noqa
  File "/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 11, in &lt;module&gt;
    from .orm import quote
  File "/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in &lt;module&gt;
    from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/home/runner/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py)
</code></pre></div>
<p dir="auto">Downgrading to <a href="https://pypi.org/project/sqlalchemy/1.3.23/" rel="nofollow">1.3.23</a> resolves this issue.</p>


<p dir="auto"><strong>How to reproduce it</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apache-airflow[crypto,celery,amazon,mysql,jdbc,password,redis,slack,snowflake,ssh,google,databricks,mongo,zendesk,papermill,salesforce]==2.0.1
iniconfig==1.1.1
sqlparse==0.4.1
google-api-python-client===1.12.8
google-auth==1.27.0
google-api-core==1.26.0
avro-python3==1.10.0
databricks-connect==7.3.8
matplotlib==3.3.4
scikit-learn==0.24.1
ipykernel==5.4.3
flower==0.9.5"><pre class="notranslate"><code class="notranslate">apache-airflow[crypto,celery,amazon,mysql,jdbc,password,redis,slack,snowflake,ssh,google,databricks,mongo,zendesk,papermill,salesforce]==2.0.1
iniconfig==1.1.1
sqlparse==0.4.1
google-api-python-client===1.12.8
google-auth==1.27.0
google-api-core==1.26.0
avro-python3==1.10.0
databricks-connect==7.3.8
matplotlib==3.3.4
scikit-learn==0.24.1
ipykernel==5.4.3
flower==0.9.5
</code></pre></div>
<p dir="auto">Hello,</p>
<p dir="auto">Client info initialization is duplicated in many places.<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/airflow/blob/349b0811c3022605426ba57d30936240a7c2848a/airflow/providers/google/cloud/_internal_client/secret_manager_client.py#L65">airflow/airflow/providers/google/cloud/_internal_client/secret_manager_client.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 65
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/349b0811c3022605426ba57d30936240a7c2848a">349b081</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L65" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="65"></td>
          <td id="LC65" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">credentials</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">credentials</span>, <span class="pl-s1">client_info</span><span class="pl-c1">=</span><span class="pl-v">ClientInfo</span>(<span class="pl-s1">client_library_version</span><span class="pl-c1">=</span><span class="pl-s">'airflow_v'</span> <span class="pl-c1">+</span> <span class="pl-s1">version</span>) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<br>
<div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/airflow/blob/8c42cf1b00c90f0d7f11b8a3a455381de8e003c5/airflow/providers/google/cloud/log/gcs_task_handler.py#L100">airflow/airflow/providers/google/cloud/log/gcs_task_handler.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 100
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/8c42cf1b00c90f0d7f11b8a3a455381de8e003c5">8c42cf1</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L100" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="100"></td>
          <td id="LC100" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">client_info</span><span class="pl-c1">=</span><span class="pl-v">ClientInfo</span>(<span class="pl-s1">client_library_version</span><span class="pl-c1">=</span><span class="pl-s">'airflow_v'</span> <span class="pl-c1">+</span> <span class="pl-s1">version</span>.<span class="pl-s1">version</span>), </td>
        </tr>
    </tbody></table>
  </div>
</div>
<br>
<div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/airflow/blob/b40dffa08547b610162f8cacfa75847f3c4ca364/airflow/providers/google/common/hooks/base_google.py#L343">airflow/airflow/providers/google/common/hooks/base_google.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 343
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/b40dffa08547b610162f8cacfa75847f3c4ca364">b40dffa</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L343" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="343"></td>
          <td id="LC343" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">client_info</span> <span class="pl-c1">=</span> <span class="pl-v">ClientInfo</span>(<span class="pl-s1">client_library_version</span><span class="pl-c1">=</span><span class="pl-s">'airflow_v'</span> <span class="pl-c1">+</span> <span class="pl-s1">version</span>.<span class="pl-s1">version</span>) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<br>
<div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/airflow/blob/8c42cf1b00c90f0d7f11b8a3a455381de8e003c5/airflow/providers/google/cloud/log/stackdriver_task_handler.py#L112">airflow/airflow/providers/google/cloud/log/stackdriver_task_handler.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 112
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/8c42cf1b00c90f0d7f11b8a3a455381de8e003c5">8c42cf1</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L112" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="112"></td>
          <td id="LC112" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">client_info</span><span class="pl-c1">=</span><span class="pl-v">ClientInfo</span>(<span class="pl-s1">client_library_version</span><span class="pl-c1">=</span><span class="pl-s">'airflow_v'</span> <span class="pl-c1">+</span> <span class="pl-s1">version</span>.<span class="pl-s1">version</span>), </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">It would be great if you could reduce these duplications and use one object created at the module level.<br>
Of course, we must not forget that this change should be backward compatible and that old references displayed deprecation warnings. (GoogleBaseHook.client_info.</p>