Skip to content

Replace dynamic evaluation in filtering - #1442

Draft
YT-er wants to merge 1 commit into
griffithlab:8.0.0from
YT-er:codex/remove-filter-eval
Draft

Replace dynamic evaluation in filtering#1442
YT-er wants to merge 1 commit into
griffithlab:8.0.0from
YT-er:codex/remove-filter-eval

Conversation

@YT-er

@YT-er YT-er commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace dynamic eval() use in tabular filtering with an explicit operator map
  • parse filter values and thresholds as numeric input
  • reject unsupported operators and malformed values with contextual errors
  • add regression coverage for every supported comparison, invalid operators, and malicious input

Why

Filter values originate in TSV data. Constructing and evaluating Python expressions from those values can execute unintended code and produces unclear failures for malformed input.

Impact

Valid numeric filters retain their existing behavior, including NA, skipped values, and inf. Invalid operators and non-numeric values now fail deterministically.

Validation

  • python -m unittest tests.test_filter — 13 tests passed
  • Python compile check passed for the changed source and test
  • git diff --check passed

This is one focused replacement for part of #1430 and is based on 8.0.0.

AI assistance disclosure

This PR was AI-assisted using OpenAI Codex for implementation, test drafting, and command execution. I reviewed the diff line by line, ran the validation above, and take responsibility for the submitted changes.

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