Skip to content

fix: aggFn use default instead of null #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 29, 2025

Conversation

dhable
Copy link

@dhable dhable commented Apr 28, 2025

Switched to the -OrDefault version of the float conversion when combined with the aggregate functions to prevent emitting null.

Ref: HDX-1379

Copy link

changeset-bot bot commented Apr 28, 2025

🦋 Changeset detected

Latest commit: cb240c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/common-utils Minor
@hyperdx/api Minor
@hyperdx/app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdx-v2-oss-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2025 6:03pm

Switched to the -OrDefault version of the float conversion when
combined with the aggregate functions to prevent emitting null.

Ref: HDX-1379
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with numeric aggregate functions by switching from a null conversion approach to one that uses the type’s default value. Key changes include updating the unsafe SQL expression in the chart config rendering, adding the executeSqlCommand helper in the API package, and introducing new tests for the aggFn functionality.

Reviewed Changes

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

File Description
packages/common-utils/src/renderChartConfig.ts Updated the SQL expression conversion from toFloat64OrNull to toFloat64OrDefault
packages/api/src/fixtures.ts Added a helper function executeSqlCommand for executing SQL commands against ClickHouse
packages/api/src/clickhouse/tests/renderChartConfig.test.ts Introduced tests for numeric aggregate functions that now use default values
.changeset/curly-ducks-jump.md Documented the changes for numeric aggregates in the changeset
Files not reviewed (2)
  • packages/api/src/clickhouse/tests/snapshots/renderChartConfig.test.ts.snap: Language not supported
  • packages/common-utils/src/tests/snapshots/renderChartConfig.test.ts.snap: Language not supported

@kodiakhq kodiakhq bot merged commit 79fe30f into v2 Apr 29, 2025
6 checks passed
@kodiakhq kodiakhq bot deleted the dan/hdx-1379-bug-aggfn-max-on-string-field-returns-null branch April 29, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants