refactor: audit broad except sites in ops.py#255
Merged
hachej merged 1 commit intorefactor/xorq-shimfrom May 5, 2026
Merged
Conversation
Walked all 26 except Exception blocks. Result: - 4 narrowed to specific types: 3 ImportError sites (xorq imports inside try blocks, only ImportError makes sense) and 1 (AttributeError, TypeError) for _is_mean_expr's duck-type probe. - 8 silent fallbacks now log at logger.debug with exc_info so backend- compat / probing failures are observable in development without flooding production logs. These cover from_ibis fallback, walk_nodes on plain ibis trees, join-defer eligibility checks, full-join chasm fallback, and column-requirement traversal fallbacks. - The remaining 22 broad excepts are intentional: predicate-probing loops that test whether a filter applies to a given table, repr fallbacks that must never raise, Result-pattern wrappers that re-encapsulate any exception, and the dim-resolution loop that recovers via _extract_missing_column_name. No behavior change. 930 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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.
Stacked PR — 2 of 3
This PR is stacked on top of #254 (
refactor/xorq-shim). It targets that branch, notmain. Read in order:refactor/xorq-shim→main) — must land firstrefactor/except-audit→refactor/xorq-shim)refactor/split-ops→refactor/except-audit(next in stack)Each PR in the stack is independently green. Once #254 merges, GitHub will retarget this PR to
mainautomatically.Summary
Walked all 26 broad
except Exceptionblocks inops.pyand made a per-site call. Results:ImportError(xorq imports insidetry); 1(AttributeError, TypeError)for_is_mean_expr's duck-type probelogger.debug(..., exc_info=True)so backend-compat / probing failures are observable in development without flooding production logs_extract_missing_column_nameWhy
The audit started from the concern that broad
except Exceptionblocks inops.pycould turn user errors (typo'd column, bad lambda) into silent wrong results instead of clear errors.After walking each site: most are legitimate xorq/ibis API-drift fallbacks or intentional probing loops — but they were silent, which made debugging harder than it needed to be. Adding
logger.debugwithexc_info=Truekeeps the fallback behavior identical while making failures visible when you turn debug logging on.What's logged now
from_ibisfallback when backend isn't xorq-supported (e.g. Databricks)walk_nodesfailures on plain ibis trees (3 sites)Non-goals
DEBUG.Test plan
ImportErrorsites still trigger their fallback when xorq is fully installed (sanity-checked)🤖 Generated with Claude Code