Skip to content

fix: preserve '=' inside --filter values - #442

Open
jacalata wants to merge 2 commits into
developmentfrom
jac/filter-equals-in-value
Open

fix: preserve '=' inside --filter values#442
jacalata wants to merge 2 commits into
developmentfrom
jac/filter-equals-in-value

Conversation

@jacalata

Copy link
Copy Markdown
Contributor

Summary

  • apply_filter_value split on every =, so --filter "Notes=x=y" silently became name=Notes, value=x. Values that legitimately contain = (config strings, formulas, part numbers, etc.) were being truncated.
  • Fix: split on the first = only (maxsplit=1), and raise a clear error when the input isn't in name=value form.
  • Adds three unit tests covering = inside the value, multiple = inside the value, and a trailing = (empty value).

Verification

Verified end-to-end against a live workbook containing product names with = characters:

Filter Before After
Product Name=Widget Plain (baseline) 1 row 1 row
Product Name=x=y Config Kit 0 rows (silent truncation) 1 row (correct)

Test plan

  • pytest tests/commands/test_datasources_and_workbooks_command.py — 28 passed
  • End-to-end tabcmd export --csv --filter "Product Name=x=y Config Kit" against a real Tableau Cloud site returns the expected single row

🤖 Generated with Claude Code

Previously `apply_filter_value` called `value.split("=")`, so a filter
like `Notes=x=y` silently truncated to name=Notes, value=x. Split on the
first '=' only (maxsplit=1) so multi-'=' values round-trip intact, and
raise a clear error when the input isn't in name=value form.

Verified end-to-end against a real workbook: `Product Name=x=y Config Kit`
now filters correctly instead of returning empty results.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dataset with product names containing '=', '&', ',', backslashes, and
metacharacter samples for exercising --filter parsing edge cases against
a real server. Also includes columns whose names contain '&', '#', and
'\' so future tests can exercise special characters on both sides of
the name=value pair.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jacalata
jacalata changed the base branch from main to development July 30, 2026 21:57
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.

1 participant