Skip to content

[BUGFIX] Fix crash rendering results with unexpected_index_column_names and no domain column#11943

Open
Bharath-970 wants to merge 1 commit into
fivetran:developfrom
Bharath-970:fix/render-util-no-domain-column-groupby-11933
Open

[BUGFIX] Fix crash rendering results with unexpected_index_column_names and no domain column#11943
Bharath-970 wants to merge 1 commit into
fivetran:developfrom
Bharath-970:fix/render-util-no-domain-column-groupby-11933

Conversation

@Bharath-970

Copy link
Copy Markdown
  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with [BUGFIX]
  • Code is linted - ran ruff format + ruff check on the changed files (clean)
  • Appropriate tests and docs have been updated

Closes #11933.

Problem

When result_format=COMPLETE and unexpected_index_column_names is specified, but no separate domain/value column is tracked alongside the ID/PK columns, rendering the validation result for Data Docs crashes:

ValueError: No group keys passed!

Root cause

_convert_unexpected_indices_to_df (great_expectations/render/util.py) computes domain_column_name_list as whatever keys of an unexpected_index_list entry are not in unexpected_index_column_names. When every key in the dict is an ID/PK column -- i.e. there's no separate domain column present -- that list ends up empty, and pandas.DataFrame.groupby([]) raises.

Fix

Branch on whether there's actually a domain column to group by:

if domain_column_name_list:
    all_unexpected_indices = unexpected_index_df.groupby(domain_column_name_list).agg(_agg_func)
else:
    # No domain column to group by -- each row already stands on its own;
    # wrap its values in a single-item list to match the shape
    # .groupby().agg(_agg_func) would otherwise produce.
    all_unexpected_indices = unexpected_index_df.map(lambda x: [x])

With no domain column, every unexpected row is already its own group of one -- there's nothing to merge across rows, so this skips straight to the equivalent output shape instead of crashing. The existing grouped path (domain column present) is untouched.

Test

Added test_convert_unexpected_indices_to_df_no_domain_column in tests/render/test_util.py, directly exercising the previously-crashing input shape (matches the existing test style in that file).

Confirmed as a true regression guard: reverting the fix reproduces the exact original ValueError: No group keys passed!; restoring it passes.

Verification

  • Reproduced the original crash directly against _convert_unexpected_indices_to_df
  • Confirmed the fix resolves it with correct output, and the existing grouped (domain-column-present) path is unaffected
  • tests/render/test_util.py: 22 passed
  • Broader tests/render/: 168 passed, 2 xfailed (pre-existing, unrelated)
  • ruff check / ruff format --check: clean

…es and no domain column

_convert_unexpected_indices_to_df computes domain_column_name_list as
whatever keys of an unexpected_index_list entry aren't in
unexpected_index_column_names. When every key IS an ID/PK column (no
separate domain/value column present -- e.g. result_format=COMPLETE with
unexpected_index_column_names covering all tracked keys), that list is
empty and pandas.DataFrame.groupby([]) raises:

    ValueError: No group keys passed!

aborting Data Docs rendering for the affected result.

With no domain column to group by, each unexpected row already stands on
its own -- there's nothing to merge across rows. Skip the groupby/agg in
that case and wrap each row's values in a single-item list directly,
matching the same output shape .groupby().agg() would otherwise produce.

Added a regression test exercising the previously-crashing input shape;
confirmed as a true guard (fails without the fix, passes with it). Full
tests/render/ suite: 168 passed.

Closes fivetran#11933.
@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

👷 Deploy request for niobium-lead-7998 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit a91b718

@Bharath-970

Copy link
Copy Markdown
Author

Opened against the wrong repo by mistake — this PR targets a fork (fivetran/great_expectations), not upstream. Closing and reopening at great-expectations/great_expectations.

@Bharath-970

Copy link
Copy Markdown
Author

Apologies for the churn — I incorrectly assumed fivetran/great_expectations was a fork rather than the actual current home of this project (renamed/transferred from great-expectations/great_expectations, with GitHub auto-redirecting). Reopening this one; closed the accidental duplicate (#11948).

@Bharath-970 Bharath-970 reopened this Jul 4, 2026
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.

Incomplete rendering of results when unexpected_index_column_names is provided

1 participant