ConstantinoSchillebeeckx opened a new issue #14818:
URL: https://github.com/apache/airflow/issues/14818


   
   
   **Apache Airflow version**: 2.0.1
   
   
   **What happened**:
   
   I'm seeing the following when running migrations in Airflow using 
[SQLAlchmey 1.4.0](https://pypi.org/project/sqlalchemy/1.4.0/):
   ```
   Traceback (most recent call last):
     File "/home/runner/.local/bin/airflow", line 8, in <module>
       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 "<frozen importlib._bootstrap_external>", line 728, in exec_module
     File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
     File 
"/home/runner/.local/lib/python3.7/site-packages/airflow/migrations/env.py", 
line 108, in <module>
       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 "<string>", 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 "<frozen importlib._bootstrap_external>", line 728, in exec_module
     File "<frozen importlib._bootstrap>", 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 <module>
       from airflow.www.app import create_app
     File "/home/runner/.local/lib/python3.7/site-packages/airflow/www/app.py", 
line 38, in <module>
       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 <module>
       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 <module>
       from airflow.www import auth, utils as wwwutils
     File 
"/home/runner/.local/lib/python3.7/site-packages/airflow/www/utils.py", line 
27, in <module>
       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 <module>
       from sqlalchemy_utils.types.uuid import UUIDType
     File 
"/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", 
line 1, in <module>
       from .aggregates import aggregated  # noqa
     File 
"/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py",
 line 372, in <module>
       from .functions.orm import get_column_key
     File 
"/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py",
 line 1, in <module>
       from .database import (  # noqa
     File 
"/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py",
 line 11, in <module>
       from .orm import quote
     File 
"/home/runner/.local/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py",
 line 14, in <module>
       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)
   ```
   
   Downgrading to 1.3.23 resolves this issue.
   
   <!-- (please include exact error messages if you can) -->
   
   
   
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   
   ```
   
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
   SQLAlchemy==1.3.23
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to