Skip to content

Commit

Permalink
service.legacy: _clean_args to remove None values introduced by…
Browse files Browse the repository at this point in the history
… `locals()`
  • Loading branch information
deeenes committed Jan 28, 2025
1 parent b7b43e7 commit 2bf1cb1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion omnipath_server/service/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,18 @@ def _update_resources(self):
_log('Finished updating resource information.')


def _check_args(self, args: dict, query_type: str):
def _clean_args(self, args: dict) -> dict:
"""
Remove empty arguments and self.
"""

args.pop('self', None)
args = {k: v for k, v in args.items() if v is not None}

return args


def _check_args(self, args: dict, query_type: str):

result = []

Expand Down Expand Up @@ -1428,6 +1437,7 @@ def _query(
"""

query = None
args = self._clean_args(args)
bad_req = self._check_args(args, query_type)

if not bad_req:
Expand Down

0 comments on commit 2bf1cb1

Please sign in to comment.