Skip to content

Commit 1a315c1

Browse files
committed
fix: sqa deprecations for airflow core
1 parent 14b6312 commit 1a315c1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

airflow/utils/db_cleanup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ def _do_delete(*, query, orm_model, skip_archive, session):
196196
session.execute(delete)
197197
session.commit()
198198
if skip_archive:
199-
metadata.bind = session.get_bind()
200-
target_table.drop()
199+
bind = session.get_bind()
200+
target_table.drop(bind=bind)
201201
session.commit()
202202
print("Finished Performing Delete")
203203

airflow/www/views.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,7 @@ def index(self):
846846

847847
is_paused_count = dict(
848848
session.execute(
849-
all_dags.with_only_columns([DagModel.is_paused, func.count()]).group_by(
850-
DagModel.is_paused
851-
)
849+
all_dags.with_only_columns(DagModel.is_paused, func.count()).group_by(DagModel.is_paused)
852850
).all()
853851
)
854852

@@ -3294,7 +3292,7 @@ def next_run_datasets(self, dag_id):
32943292
latest_run = dag_model.get_last_dagrun(session=session)
32953293

32963294
events = [
3297-
dict(info)
3295+
dict(info._mapping)
32983296
for info in session.execute(
32993297
select(
33003298
DatasetModel.id,
@@ -3456,7 +3454,7 @@ def datasets_summary(self):
34563454
count_query = count_query.where(*filters)
34573455

34583456
query = session.execute(query)
3459-
datasets = [dict(dataset) for dataset in query]
3457+
datasets = [dict(dataset._mapping) for dataset in query]
34603458
data = {"datasets": datasets, "total_entries": session.scalar(count_query)}
34613459

34623460
return (

0 commit comments

Comments
 (0)