Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@whitdog47
Copy link
Contributor

@whitdog47 whitdog47 commented Nov 13, 2024

This pull request addresses a potential issue in the search_filter_sort_paginate function within the database service by ensuring that the filter_spec is of type str before attempting to deserialize it using json.loads.

Key Changes

  • Type Check for Deserialization:
    • Added a type check to ensure filter_spec is a string before calling json.loads.
    • This prevents errors that could occur if filter_spec is not a string, enhancing the robustness of the deserialization process.

Files Changed

  • src/dispatch/database/service.py:
    • Modified the search_filter_sort_paginate function to include a type check for filter_spec.
    • Modified the type signature for filter_spec to reflect that it can be None, str, or a dict.
    • Added a comment to help future developers understand why the type check was added.

@whitdog47 whitdog47 added the bug Something isn't working label Nov 13, 2024
@whitdog47 whitdog47 requested a review from wssheldon November 13, 2024 04:10
@whitdog47 whitdog47 self-assigned this Nov 13, 2024
@whitdog47 whitdog47 marked this pull request as ready for review November 13, 2024 04:10
@whitdog47 whitdog47 merged commit 908ed01 into master Nov 13, 2024
9 checks passed
@whitdog47 whitdog47 deleted the bugfix/filter-spec-sometimes-already-dict branch November 13, 2024 05:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants