Skip to content

Commit

Permalink
legacy service: made fields synonyms work
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Feb 27, 2025
1 parent 97f7af5 commit d9bb77f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions omnipath_server/service/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LegacyService:
'select': {
'genesymbol': {'source_genesymbol', 'target_genesymbol'},
'organism': {'ncbi_tax_id_source', 'ncbi_tax_id_target'},
'entity_types': {'entity_type_source', 'entity_type_target'},
'entity_type': {'entity_type_source', 'entity_type_target'},
},
'select_default': {
'source',
Expand Down Expand Up @@ -145,7 +145,7 @@ class LegacyService:
'organisms': ('ncbi_tax_id_source', 'ncbi_tax_id_target'),
'entity_types': (
'entity_type_source',
'entity_type_target'
'entity_type_target',
),
}
),
Expand Down Expand Up @@ -1745,16 +1745,10 @@ def _select(self, args: dict, query_type: str) -> Query:
tbl = self._schema(query_type)
query_fields = set()

print(param)
print("|")
print(self._parse_arg(param.get('fields', None)))

for query_field in self._parse_arg(param.get('fields', None)):
for query_field in self._parse_arg(args.get('fields', None)):

query_fields |= _misc.to_set(synonyms.get(query_field, query_field))

print(query_fields)

cols.update(_misc.to_set(query_fields))
select = [
c
Expand Down

0 comments on commit d9bb77f

Please sign in to comment.