Skip to content

add predicate-based find and filter helpers to API endpoint response Result model#53

Merged
lykmapipo merged 5 commits intodevelopfrom
feature/http-result-utils
Mar 4, 2026
Merged

add predicate-based find and filter helpers to API endpoint response Result model#53
lykmapipo merged 5 commits intodevelopfrom
feature/http-result-utils

Conversation

@lykmapipo
Copy link
Collaborator

This:

  • introduce a find() method on Result to return the first matching ResultItem
  • add a filter() method on Result to return matching ResultItem objects
  • provide comprehensive unit tests covering common find and filter scenarios

This:
- add a `filter()` instance method on `Result` to filter `ResultItem` objects
- add comprehensive unit tests for common filtering scenarios
This:
- add a `find()` instance method on `Result` to find first matching `ResultItem` object
- add comprehensive unit tests for common find scenarios
@lykmapipo lykmapipo self-assigned this Feb 10, 2026
@lykmapipo lykmapipo added the enhancement New feature or request label Feb 10, 2026
Copy link

@aperdizs aperdizs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

… find

This:
- introduce internal `_iter_data()` helper to lazily iterate over `Result` data without copying
- refactor `df()`, `filter()`, and `find()` to use unified `_iter_data()`
- make `filter()` return a shallow copy when predicate is invalid or not callable
- make `find()` safely return `None` for invalid predicates
- add unit tests covering invalid predicate handling and edge cases
@lykmapipo lykmapipo merged commit 5948879 into develop Mar 4, 2026
4 checks passed
@lykmapipo lykmapipo deleted the feature/http-result-utils branch March 4, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants