Skip to content

Commit

Permalink
Some comments and docstrings on service._legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
npalacioescat committed Feb 25, 2025
1 parent b315e14 commit d08f854
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions omnipath_server/service/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,7 @@ def queries(self, req):
)


# XXX Deprecated?
@classmethod
def _dict_set_to_list(cls, dct):

Expand All @@ -1457,7 +1458,8 @@ def _dict_set_to_list(cls, dct):
for key, val in dct.items()
}



# XXX Deprecated?
def databases(self, req):

query_type = (
Expand Down Expand Up @@ -1516,12 +1518,14 @@ def databases(self, req):
'{}\t{}'.format(k, ';'.join(v)) for k, v in result.items()
)



# XXX Deprecated?
def _get_datasets(self):

return list(self.data['interactions'].type.unique())



# XXX Deprecated?
def datasets(self, req):

query_type = (
Expand All @@ -1548,11 +1552,33 @@ def datasets(self, req):


def _schema(self, query_type: str) -> ReadOnlyColumnCollection:
"""
Retrieves the schema class of the corresponding query type (e.g.
`Interactions`, `Enzsub`, `Annotations`, etc.).
Args:
query_type:
The desired database to retrieve its schema class.
Returns:
The `_schema` class of the requested database.
"""

return getattr(_schema, query_type.capitalize())


def _columns(self, query_type: str) -> list[str]:
"""
Retrieve the list of columns of a given database as defined in its
schema.
Args:
query_type:
The desired database to retrieve its schema class.
Returns:
The list of columns of the requested database.
"""

return self._schema(query_type).__table__.columns

Expand All @@ -1570,7 +1596,7 @@ def _where_op(
# we can simplify this later, once we are sure
# it's fully correct

if op is None:
if op is None: # XXX: If not `None`, basically does nothing?

if self._isarray(col):

Expand Down

0 comments on commit d08f854

Please sign in to comment.