Skip to content

Commit

Permalink
Add comments about removing subqueries
Browse files Browse the repository at this point in the history
  • Loading branch information
upadhyeammit committed Jun 13, 2023
1 parent 014fb66 commit e95f7a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ros/api/v1/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def get(self):
system_query = system_ids_by_org_id(org_id).filter(*self.build_system_filters())
sort_expression = self.build_sort_expression(order_how, order_by)

# we don't need to convert query in subquery now, using it also raises warning,
# Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
query = (
db.session.query(PerformanceProfile, System, RhAccount)
.join(System, System.id == PerformanceProfile.system_id)
Expand Down Expand Up @@ -283,6 +285,8 @@ def get(self, host_id):
username = user['username'] if 'username' in user else None
org_id = org_id_from_identity_header(request)

# we don't need to convert query in subquery now, using it also raises warning,
# Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
system_query = system_ids_by_org_id(org_id).filter(System.inventory_id == host_id)

profile = PerformanceProfile.query.filter(
Expand Down Expand Up @@ -347,6 +351,8 @@ def get(self, host_id):

org_id = org_id_from_identity_header(request)

# we don't need to convert query in subquery now, using it also raises warning,
# Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
system_query = system_ids_by_org_id(org_id).filter(System.inventory_id == host_id)

query = PerformanceProfileHistory.query.filter(
Expand Down

0 comments on commit e95f7a0

Please sign in to comment.