Skip to content

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

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

[BUGFIX] Fix crash rendering results with unexpected_index_column_names and no domain column#11948
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

Closes #11933.

Problem

When rendering a validation result for Data Docs with result_format COMPLETE and unexpected_index_column_names set to the entire set of keys present in each unexpected_index_list entry (i.e. no separate domain/value column is tracked alongside the ID/PK columns), rendering crashes:

ValueError: No group keys passed!

Root cause

In great_expectations/render/util.py, _convert_unexpected_indices_to_df computes:

domain_column_name_list = list(
    set(first_unexpected_index.keys()).difference(set(unexpected_index_column_names))
)

When every key in first_unexpected_index is itself one of unexpected_index_column_names, this set difference is empty. The function then calls:

unexpected_index_df.groupby(domain_column_name_list).agg(_agg_func)

.groupby([]) raises ValueError: No group keys passed! since pandas requires at least one group key.

Fix

When there is no domain column to group by, there is nothing to aggregate across rows -- each row already stands on its own. Skip the groupby/agg and instead wrap each cell's own value in a single-item list, matching the same per-cell shape .groupby().agg(_agg_func) would otherwise produce (a list of values per cell), just with each list containing exactly one element instead of being merged across rows.

Test

Added test_convert_unexpected_indices_to_df_no_domain_column in tests/render/test_util.py, covering the exact scenario from the issue (dict keys == unexpected_index_column_names).

Verified as a true regression guard: fails with the original ValueError when the fix is reverted, passes with it restored. Also verified the existing grouped (domain-column-present) test cases are unaffected.

…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 4, 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

Duplicate — reopening #11943 instead, which was mistakenly closed based on a wrong assumption that this repo was a fork rather than the current (renamed/transferred) upstream. Sorry for the noise.

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