Skip to content

Commit

Permalink
♻️ Changing == by is_ in sqlalchemy queries (#6654)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov authored Nov 4, 2024
1 parent 0bc2185 commit b7814bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/maintenance/migrate_project/src/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _get_project(connection: Connection, project_uuid: UUID) -> ResultProxy:
def _get_hidden_project(connection: Connection, prj_owner: int) -> ResultProxy:
return connection.execute(
select(projects).where(
and_(projects.c.prj_owner == prj_owner, projects.c.hidden == True)
and_(projects.c.prj_owner == prj_owner, projects.c.hidden.is_(True))
)
)

Expand All @@ -61,7 +61,7 @@ def _get_file_meta_data_without_soft_links(
and_(
file_meta_data.c.node_id == f"{node_uuid}",
file_meta_data.c.project_id == f"{project_id}",
file_meta_data.c.is_soft_link != True,
file_meta_data.c.is_soft_link.is_not(True),
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def iter_latest_product_services(
)
& (services_meta_data.c.deprecated.is_(None))
& (services_access_rights.c.gid == EVERYONE_GROUP_ID)
& (services_access_rights.c.execute_access == True)
& (services_access_rights.c.execute_access.is_(True))
& (services_access_rights.c.product_name == product_name)
)
)
Expand Down Expand Up @@ -161,7 +161,7 @@ async def validate_requested_service(
sa.select(services_consume_filetypes.c.is_guest_allowed)
.where(
(services_consume_filetypes.c.service_key == service_key)
& (services_consume_filetypes.c.is_guest_allowed == True)
& (services_consume_filetypes.c.is_guest_allowed.is_(True))
)
.limit(1)
)
Expand Down

0 comments on commit b7814bb

Please sign in to comment.