Repository navigation
feat: filter reindex rows with a polars regex op - #233
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add lib.reindex_regex(df, col, pattern, negate): one lazy filter over str.contains on the column cast to String, so a typed parquet column filters on its text form instead of raising InvalidOperationError, and a null cell drops under both directions exactly as literal eq/ne drop nulls. Tcode._source_ops emits it for a regex entry with the negate flag derived from the comparison; regex-less entries keep emitting the exact tuples they always did, so run-cache op digests do not move (pinned by the new dispatch test against the literal pre-feature tuples and their digest). PHASE_OF and runcache.OP_COST both carry the new op, keeping the exhaustiveness pin green. End-to-end: a build with regex ne over several missing-value spellings emits only the surviving rows' edges, and an anchored pattern proves anchoring is the config author's job.
SkyeAv
force-pushed
the
feat/reindex-regex-pipeline
branch
from
October 21, 2026 21:43
c9eab69 to
5177618
Compare
SkyeAv
added a commit
that referenced
this pull request
Oct 22, 2026
Cut 22.2.0 and bump the package version in pyproject.toml, CITATION.cff, and uv.lock. Minor: the --qc study stage fails the build on self-referential edges via a new self-loop-edges assertion (#229); eq/ne reindex filters can match cells with a Polars regex behind a default-off regex key (#232, #233, #234); source.reindex can filter rows by identifier membership with join/antijoin semi/anti hash joins (#236). Docs: the Taxon Filtering link in the table config reference now matches its section (#228, #231). Changelog: - Versioned the Unreleased section as 22.2.0 - 2026-10-22. - Added PR links to the three Added entries (#229; #232, #233, #234; #236). - Added the missing Fixed entry for the Taxon Filtering docs link (#228, #231). Docs: none needed here; the shipped docs changes are covered by the changelog entries above. Testing: - make check -> ruff, ruff format, pyright, pytest, cargo test, cargo clippy -D warnings: all green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: filter reindex rows with a polars regex op
Wires the
Reindex.regexconfig flag (#232) into the pipeline: a regex entry filters rows through a newlib.reindex_regexop, while every regex-less entry keeps emitting the exact op tuples it always did, so run-cache digests do not move.Pipeline
lib.reindex_regex(df, col, pattern, negate)insrc/tablassert/lib.py: one lazy filter overstr.containson the column cast toString, so a typedparquetcolumn filters on its text form (22.0matches^2\d?\.0$) instead of raising polars'InvalidOperationError, and a null cell drops under both directions exactly as literaleq/nedrop nulls.Tcode._source_opsemits(reindex_regex, (idxname(column), comparator, comparison == "ne"))for a regex entry; the legacy arms are byte-identical to the previous code, andx.comparisonis the plain"ne"/"eq"string underTablaBase'suse_enum_values.lib.PHASE_OFandruncache.OP_COSTboth carry the new op, keepingtest_op_cost_covers_every_phase_of_callablegreen.Backwards compatibility
test_reindex_dispatch_keeps_legacy_ops_and_digestsasserts the emitted tuples equal the literal pre-feature tuples AND thatprefix_digestis unchanged for a regex-less config, so existing builds neither rebuild nor change which rows survive.Testing
uv run pytest tests/test_cover_lib.py -k reindex -n 0 --no-cov -q->9 passed(match, negate, unanchored search, typed-column cast, null rows, legacy tuple + digest pin, regex dispatch for both comparisons).uv run pytest tests/test_production_patterns.py -k reindex -n 0 --no-cov -q->10 passed(end-to-end builds:neover a junk family,eqshape, anchoredne).uv run pytest tests/test_run_cache.py -n 0 --no-cov -q->34 passed.uv run pytest -n 8 -q->1277 passed, 1 skipped(the skip is the opt-inTABLASSERT_CONFIG_CORPUSsweep), coverage98%.