Normalize tag filters across stores#19
Conversation
There was a problem hiding this comment.
PR Review
PR: Normalize tag filters across stores
Important
Verdict: Request changes - 1 actionable finding, highest severity P0.
Findings (1)
Broken indentation in normalize_tag_filters
src/cashet/_client_base.py:93-95
The function body ends after the first if block because lines 93-95 are outdented to module level. This causes a NameError at import time for the bare if not tags: at module scope, or if that is bypassed the function returns None for truthy input, leading to AttributeError in callers.
How To Recheck
Reply @ds-review recheck under the relevant inline finding after pushing a fix.
| ) -> dict[str, str | None]: | ||
| if not tags: | ||
| return {} | ||
| return {str(key): str(value) for key, value in tags.items() if value is not None} |
There was a problem hiding this comment.
normalize_tag_filters drops None-valued tag existence filters
The dict comprehension filters out entries where value is None, but None indicates existence-only checks (key present, any value). This breaks tag filtering in list_commits and delete_by_tags because such filters become empty and are ignored.
| return {str(key): str(value) for key, value in tags.items() if value is not None} | |
| if not tags: | |
| return {} | |
| return {str(k): str(v) if v is not None else None for k, v in tags.items()} |
Thanks Co-authored-by: ds-review[bot] <279337960+ds-review[bot]@users.noreply.github.com>
Summary
Testing
uv run ruff check src/cashet/_client_base.py src/cashet/store.py src/cashet/redis_store.py