Skip to content

fix: reject impossible created range in build_filter() - #17

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
sharadvc:fix/build-filter-range-order
Sep 16, 2026
Merged

royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
sharadvc:fix/build-filter-range-order

Conversation

@sharadvc

Copy link
Copy Markdown
Contributor

What

build_filter() with created_after > created_before silently built an impossible Range(gte, lte) that always returned empty with no error, hiding caller bugs.

Change

Raise ValueError when the created range is inverted, so the caller learns immediately instead of chasing empty results.

Tests

Added a failing test first: build_filter("acme", created_after=200, created_before=100) raises ValueError, while created_after=100, created_before=200 still builds the filter. Suite: 24 passed. ruff check clean.

Related

Closes #12

created_after > created_before silently built an impossible
Range(gte, lte) that returned empty with no error, hiding caller bugs.
Raise ValueError when the range is inverted.

Closes AgentPostmortem#12
@royalpinto007
royalpinto007 merged commit cace8b3 into AgentPostmortem:main Sep 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build_filter() silently builds an impossible range when created_after > created_before

2 participants