Skip to content

Commit

Permalink
Use declarative_base from sqlalchemy.orm instead of `sqlalchemy.e…
Browse files Browse the repository at this point in the history
…xt.declarative` (#39134)
  • Loading branch information
Taragolis authored Apr 20, 2024
1 parent 90acbfb commit 2358064
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

def upgrade():
"""Create DagCode Table."""
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import declarative_base

Base = declarative_base()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import sqlalchemy as sa
from alembic import op
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import declarative_base

# revision identifiers, used by Alembic.
revision = "8f966b9c467a"
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/img/airflow_erd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cccb1a4a3f22027e354cea27bb34996fd45146494cbe6893d938c02c2ddb1a61
072fb4b43a86ccb57765ec3f163350519773be83ab38b7ac747d25e1197233e8
140 changes: 70 additions & 70 deletions docs/apache-airflow/img/airflow_erd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,11 @@ banned-module-level-imports = ["numpy", "pandas"]
"unittest.skipIf".msg = "Use `pytest.mark.skipif` instead: https://docs.pytest.org/en/stable/reference/reference.html#marks"
"unittest.skipUnless".msg = "Use `pytest.mark.skipif` instead: https://docs.pytest.org/en/stable/reference/reference.html#marks"
"unittest.expectedFailure".msg = "Use `pytest.mark.xfail` instead: https://docs.pytest.org/en/stable/reference/reference.html#marks"

# Moved in SQLAlchemy 2.0
"sqlalchemy.ext.declarative.declarative_base".msg = "Use `sqlalchemy.orm.declarative_base`. Moved in SQLAlchemy 2.0"
"sqlalchemy.ext.declarative.as_declarative".msg = "Use `sqlalchemy.orm.as_declarative`. Moved in SQLAlchemy 2.0"
"sqlalchemy.ext.declarative.has_inherited_table".msg = "Use `sqlalchemy.orm.has_inherited_table`. Moved in SQLAlchemy 2.0"
"sqlalchemy.ext.declarative.synonym_for".msg = "Use `sqlalchemy.orm.synonym_for`. Moved in SQLAlchemy 2.0"

[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
Expand Down

0 comments on commit 2358064

Please sign in to comment.