Skip to content

Commit

Permalink
service.legacy: do not include id column
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Jan 28, 2025
1 parent e9f7a28 commit 5d322dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions omnipath_server/service/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,11 +1400,11 @@ def _select(self, args: dict, query_type: str, param: dict) -> Query:
tbl = self._schema(query_type)
query_fields = self._parse_arg(param.get('fields', None))
cols.update(_misc.to_set(query_fields))
select = (
[tbl] # this is SELECT * ...
if not cols else
[c for c in tbl.__table__.columns if c.name in cols]
)
select = [
c
for c in tbl.__table__.columns
if c.name != 'id' and (not cols or c.name in cols)
]

# Instance of sqlalchemy.orm.Query
return self.con.session.query(*select)
Expand Down

0 comments on commit 5d322dd

Please sign in to comment.