Skip to content
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

fix(widget-builder): Aggregates with no column not wiped #83410

Merged

Conversation

narsaynorath
Copy link
Member

Take the following scenario:

  • Choose the transaction dataset
  • select transaction.duration (i.e. set aggregate to None, set transaction.duration in the column field)
  • update the aggregate to count()

The request is being made with count(transaction_duration) which shouldn't happen. I added a validate parameter helper that checks the parameter type, validates it, and if it's not valid then set it to the default value.

@narsaynorath narsaynorath requested a review from a team as a code owner January 14, 2025 18:04
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 14, 2025
Comment on lines -696 to +713
parameter.value ?? ('defaultValue' in parameter && parameter?.defaultValue) ?? '',
currentValue ?? ('defaultValue' in parameter && parameter?.defaultValue) ?? '',
Copy link
Member Author

Choose a reason for hiding this comment

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

Also snuck in this change. I realized that when I would update the value in count_if(transaction.duration,equals,300), the text field wouldn't update and this is why

Copy link
Member

@nikkikapadia nikkikapadia left a comment

Choose a reason for hiding this comment

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

lgtm

@narsaynorath narsaynorath merged commit 03b6f6b into master Jan 14, 2025
43 checks passed
@narsaynorath narsaynorath deleted the nar/fix/widget-builder-aggregates-with-no-column-not-wiped branch January 14, 2025 18:19
andrewshie-sentry pushed a commit that referenced this pull request Jan 22, 2025
Take the following scenario:
- Choose the transaction dataset
- select `transaction.duration` (i.e. set aggregate to None, set
`transaction.duration` in the column field)
- update the aggregate to `count()`

The request is being made with `count(transaction_duration)` which
shouldn't happen. I added a validate parameter helper that checks the
parameter type, validates it, and if it's not valid then set it to the
default value.
Copy link

sentry-io bot commented Jan 23, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: �[2mexpect(�[22m�[31melement�[39m�[2m).toHaveValue(�[22m�[32m300�[39m�[2m)�[22m Object.?(visualize.spec.tsx) View Issue

Did you find this useful? React with a 👍 or 👎

@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants