Skip to content

Improve Filtering Function by Defering Type Coercion #10

@le91688

Description

@le91688

Title: Improve Filtering Function by Defering Type Coercion

Description:

Currently, our filtering function coerces boolean string values to actual boolean values too early in the process. This early coercion makes it impossible to match a string value of "true" in the device information JSON.

We propose to improve the filtering function by deferring type coercion until we know the type of the value in the JSON we are filtering against. This will enhance the flexibility and correctness of our filtering operations.

Tasks:

  1. Refactor the filtering function to get the type from the device information JSON before performing type coercion.
  2. Adjust the logic of the filtering function to cast the criteria to match the type derived from the device information JSON.
  3. Test the refactored filtering function with a variety of different device information scenarios and criteria types.
  4. Update the function documentation to reflect the changes in the type coercion logic.

Acceptance Criteria:

  • The filtering function correctly determines the type from the device information JSON before performing type coercion.
  • The filtering function correctly matches and casts criteria according to the derived type.
  • The refactored filtering function works correctly with various device information and criteria type scenarios.
  • The function documentation is updated to include the new type coercion logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions