mikebridge opened a new pull request, #41856: URL: https://github.com/apache/superset/pull/41856
### SUMMARY Fourth contribution **into #40221's branch** (`sl-cache`). The unit-test CI job gates `superset/semantic_layers/` at **100% coverage** (`--cov-fail-under=100`), and the branch sits at **86.44%** — its own `unit-tests (current)` is red, and every stacked PR inherits the red regardless of its own coverage. This closes the gap to **100.00%** (499 tests), which also directly addresses the long-standing patch-coverage review comment. Mostly table-driven tests over the untested edges: the full pairwise **filter-implication matrix**, `can_satisfy` rejection edges, the **leftover-mask operator matrix**, `LIKE`→regex translation, the `MAX_ENTRIES` trim, serialization helpers, and mapper's complete **filter-value coercion matrix** (every dtype's accept/reject branches). **One real bug found and fixed** (the point of testing these branches): negative leftover masks (`NOT_EQUALS`/`NOT_IN`/`NOT_LIKE`) kept NULL rows — pandas evaluates `NaN != x` as True, but SQL three-valued logic excludes NULLs from negative predicates. **Cache-served results could contain rows the warehouse would have dropped.** The masks now AND with `notna()`, pinned by the operator matrix. **Two findings flagged, not changed**: - `_sql_like_to_regex` has **no escape-character support** — `LIKE '100\%'` wildcards the `%`, diverging from warehouses (PostgreSQL escapes with backslash by default). The test pins current behavior; if escape support is added, extend the table. - Two provably-dead fallthroughs in `_implies_range` (both same-direction range-op combos are exhaustively enumerated above them) carry justified `# pragma: no cover` comments — deleting the dead lines is equally fine if preferred. ### TESTING INSTRUCTIONS ```bash pytest --cov=superset/semantic_layers/ tests/unit_tests/semantic_layers/ --cov-fail-under=100 -q # 499 passed · Required test coverage of 100% reached. Total coverage: 100.00% ``` Once this merges into `sl-cache`, the branch's own `unit-tests (current)` and every stacked PR's (#41824/#41825/#41826) go green. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
