Skip to content

Commit

Permalink
Revert Fab Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bugraoz93 committed Dec 27, 2024
1 parent e01cf3f commit 0c8e1fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,12 @@
from __future__ import annotations

from airflow import settings
from airflow.cli.commands.local_commands.db_command import run_db_downgrade_command, run_db_migrate_command
from airflow.providers.fab.auth_manager.models.db import _REVISION_HEADS_MAP, FABDBManager
from airflow.providers.fab.version_compat import AIRFLOW_V_3_0_PLUS
from airflow.utils import cli as cli_utils
from airflow.utils.providers_configuration_loader import providers_configuration_loaded


def get_db_command():
"""Import the correct db_command module based on the Airflow version."""
if AIRFLOW_V_3_0_PLUS:
import airflow.cli.commands.local_commands.db_command as db_command
else:
import airflow.cli.commands.db_command as db_command

return db_command


@providers_configuration_loaded
def resetdb(args):
"""Reset the metadata database."""
Expand All @@ -48,7 +38,7 @@ def migratedb(args):
"""Migrates the metadata database."""
session = settings.Session()
upgrade_command = FABDBManager(session).upgradedb
get_db_command().run_db_migrate_command(
run_db_migrate_command(
args, upgrade_command, revision_heads_map=_REVISION_HEADS_MAP, reserialize_dags=False
)

Expand All @@ -59,4 +49,4 @@ def downgrade(args):
"""Downgrades the metadata database."""
session = settings.Session()
dwongrade_command = FABDBManager(session).downgrade
get_db_command().run_db_downgrade_command(args, dwongrade_command, revision_heads_map=_REVISION_HEADS_MAP)
run_db_downgrade_command(args, dwongrade_command, revision_heads_map=_REVISION_HEADS_MAP)
29 changes: 0 additions & 29 deletions providers/src/airflow/providers/fab/version_compat.py

This file was deleted.

0 comments on commit 0c8e1fe

Please sign in to comment.