Skip to content

Commit

Permalink
chore: cleanup unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv-ahuja committed Sep 6, 2024
1 parent 3633263 commit 542ada0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
26 changes: 0 additions & 26 deletions src/schemas/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,3 @@ def parse_sort_input(query_params: list[str] | None) -> list["SortSchema"] | Non
class FilterSortInput(BaseModel):
filter_: Annotated[FilterInputType, BeforeValidator(FilterSchema.parse_filter_input)] = Field(None, alias="filter")
sort: Annotated[SortInputType, BeforeValidator(SortSchema.parse_sort_input)]

@staticmethod
def parse_filter_input(query_params: list[str] | None) -> list[FilterSchema] | None:
if query_params is None:
return

filter_params = []
valid_params = True

for query_param in query_params:
try:
field, operation, value = query_param.split(":")
if operation not in FILTER_OPERATION.__args__: # type: ignore
valid_params = False
break

filter_param = FilterSchema(field=field, operation=operation, value=value) # type: ignore
except Exception:
valid_params = False

if not valid_params:
raise ValueError("Invalid input. Incorrect 'filter' query params.")

filter_params.append(filter_param)

return filter_params
1 change: 0 additions & 1 deletion src/utils/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def convert_decimal(dict_item: dict | None):
if dict_item is None:
return None

# for k,v in list(dict_item.items()):
for key, value in dict_item.items():
if isinstance(value, dict):
convert_decimal(value)
Expand Down

0 comments on commit 542ada0

Please sign in to comment.