Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Fix format filtering for missing dimensions - #15

Merged
bokelley merged 2 commits into
mainfrom
bokelley/fix-format-filtering
Oct 16, 2025
Merged

Fix format filtering for missing dimensions#15
bokelley merged 2 commits into
mainfrom
bokelley/fix-format-filtering

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Background

When the buy-side UI requested formats with specific dimension constraints, the creative agent was incorrectly returning audio formats (which have no dimensions) and display formats that did not match the requested dimensions. This was due to misleading comments in the filtering logic.

Changes

  • src/creative_agent/data/standard_formats.py: Updated the comment at line 1156 to accurately reflect that formats without dimensions are excluded when dimension filtering is requested. The underlying code logic correctly excluded these formats, but the comment implied they were being skipped over, which was confusing.

Testing

  • Manually verify that audio formats are excluded when dimension constraints are applied.
  • Manually verify that display formats not matching dimension constraints are excluded.
  • Confirm that existing tests for format filtering still pass.

bokelley and others added 2 commits October 16, 2025 00:05
When dimension filters (max_width, max_height, min_width, min_height)
are specified, exclude formats that don't have dimensions defined.

This prevents audio formats and other non-dimensional formats from
appearing in buy-side UI results when filtering by specific dimensions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Tests cover:
- Dimension filtering (exact, min/max, combined)
- Type filtering (display, audio, video, native, dooh)
- Name search filtering
- Format ID filtering
- Combined filters
- Bug reproduction test for audio formats appearing with dimension filters

All 23 tests pass, improving coverage of filter_formats from 19% to 64%.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley
bokelley merged commit df0d20b into main Oct 16, 2025
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant