Skip to content

fix: DH-13522: exclude some aggs for arrays#2697

Open
jnumainville wants to merge 1 commit into
deephaven:mainfrom
jnumainville:13522_array_aggs
Open

fix: DH-13522: exclude some aggs for arrays#2697
jnumainville wants to merge 1 commit into
deephaven:mainfrom
jnumainville:13522_array_aggs

Conversation

@jnumainville

Copy link
Copy Markdown
Contributor

CountDistinct, Distinct, Unique aggs now are empty for array columns instead of throwing an error

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates aggregation validation to treat array-typed columns as unsupported for distinct-style aggregations, preventing errors by excluding those columns from CountDistinct, Distinct, and Unique operations.

Changes:

  • Added TableUtils.isArrayType helper (and unit tests) to detect []-style array column types.
  • Updated isValidOperation to disallow COUNT_DISTINCT, DISTINCT, and UNIQUE for array columns (while leaving COUNT, FIRST, LAST valid for any type).
  • Added dedicated unit tests for aggregation operation/type validity in iris-grid.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/jsapi-utils/src/TableUtils.ts Adds isArrayType helper used to gate operations on array-typed columns.
packages/jsapi-utils/src/TableUtils.test.ts Adds unit coverage for isArrayType.
packages/iris-grid/src/sidebar/aggregations/AggregationUtils.ts Excludes distinct-style aggregations for array column types via isValidOperation.
packages/iris-grid/src/sidebar/aggregations/AggregationUtils.test.ts Adds unit tests asserting validity rules for operations vs column types, including arrays.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.72%. Comparing base (caeabb0) to head (7511a11).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2697      +/-   ##
==========================================
+ Coverage   50.43%   50.72%   +0.28%     
==========================================
  Files         788      788              
  Lines       44909    44912       +3     
  Branches    11442    11442              
==========================================
+ Hits        22652    22782     +130     
+ Misses      22238    22111     -127     
  Partials       19       19              
Flag Coverage Δ
unit 50.72% <100.00%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jnumainville jnumainville requested review from a team, SimonVutov, bmingles, ethanalvizo and mattrunyon and removed request for a team, SimonVutov, ethanalvizo and mattrunyon June 11, 2026 18:41
@jnumainville jnumainville marked this pull request as ready for review June 11, 2026 18:42
];

it.each(ops)('%s returns true for any column type', op => {
expect(isValidOperation(op, 'int')).toBe(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason these are single type checks instead of using the type arrays defined at top of test?

];

it.each(ops)('%s returns true for non-array types', op => {
expect(isValidOperation(op, 'int')).toBe(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason these are single type checks instead of using the type arrays defined at top of test?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same general question for any other tests that only target a single value in cases where we expect all in an array to match.

@bmingles bmingles left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me overall. Left a few questions on unit test.

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.

3 participants