Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ repos:
^airflow-ctl.*\.py$|
^airflow-core/src/airflow/models/.*\.py$|
^airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py$|
^airflow-core/tests/unit/utils/test_cli_util\.py$|
^task_sdk.*\.py$
pass_filenames: true
- id: update-supported-versions
Expand Down
5 changes: 3 additions & 2 deletions airflow-core/tests/unit/utils/test_cli_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from unittest import mock

import pytest
from sqlalchemy import select

import airflow
from airflow import settings
Expand Down Expand Up @@ -175,7 +176,7 @@ def test_cli_create_user_supplied_password_is_masked(
mock_create_session.return_value.bulk_insert_mappings = session.bulk_insert_mappings
cli_action_loggers.default_action_log(**metrics)

log = session.query(Log).order_by(Log.dttm.desc()).first()
log = session.execute(select(Log).order_by(Log.dttm.desc())).scalars().first()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @0lai0
What if we write it this way?

log = session.scalars(select(Log).order_by(Log.dttm.desc())).first()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let me modify it. Thanks @Prab-27 .


assert metrics.get("start_datetime") <= timezone.utcnow()

Expand Down Expand Up @@ -234,7 +235,7 @@ def test_cli_set_variable_supplied_sensitive_value_is_masked(
mock_create_session.return_value.bulk_insert_mappings = session.bulk_insert_mappings
cli_action_loggers.default_action_log(**metrics)

log = session.query(Log).order_by(Log.dttm.desc()).first()
log = session.execute(select(Log).order_by(Log.dttm.desc())).scalars().first()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here,

log = session.scalars(select(Log).order_by(Log.dttm.desc())).first()

What do you think ?


assert metrics.get("start_datetime") <= timezone.utcnow()

Expand Down
Loading