Skip to content

Refactor explain to a common help #509

Open
hadia206 wants to merge 2 commits intomainfrom
Hadia/explain_refactor
Open

Refactor explain to a common help #509
hadia206 wants to merge 2 commits intomainfrom
Hadia/explain_refactor

Conversation

@hadia206
Copy link
Copy Markdown
Contributor

@hadia206 hadia206 commented Apr 10, 2026

Extracts shared logic from explain.py into a new pydough/exploration/_common.py module, laying groundwork for the upcoming explain_llm API.

No behavior changes. The user-facing output of pydough.explain() is identical.

Changes:

  • Replaces inline term-gathering loop with extract_terms()
  • Replaces inline AND-condition splitting with extract_conditions()
  • Replaces bare try/except around qualify_node with qualify_safely(), which returns (result, error) instead of raising
  • Adds find_source_collection() for walking the preceding_context chain to the root TableCollection

@hadia206 hadia206 requested review from a team, john-sanchez31, juankx-bodo and knassre-bodo and removed request for a team April 10, 2026 21:42
@hadia206 hadia206 marked this pull request as ready for review April 10, 2026 21:42
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