Skip to content

Conversation

Zylphrex
Copy link
Member

@Zylphrex Zylphrex commented Oct 3, 2025

Numeric attributes should be permitted as an argument to count_unique.

Requires #100889

Closes for LOGS-398

Numeric attributes should be permitted as an argument to count_unique.

Requires #100889

Frontend for LOGS-398
@Zylphrex Zylphrex requested review from a team as code owners October 3, 2025 17:15
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 3, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #100895      +/-   ##
===========================================
- Coverage   81.15%    81.15%   -0.01%     
===========================================
  Files        8615      8615              
  Lines      382250    382237      -13     
  Branches    24033     24029       -4     
===========================================
- Hits       310199    310187      -12     
+ Misses      71723     71722       -1     
  Partials      328       328              

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: COUNT_UNIQUE Filter Inconsistency

The COUNT_UNIQUE aggregation in spans.tsx now supports both 'number' and 'string' column types. However, the filterAggregateParams function in the same file still only accepts 'string' types for this aggregation. This inconsistency prevents users from selecting valid numeric attributes for COUNT_UNIQUE operations on spans.

static/app/views/dashboards/datasetConfig/spans.tsx#L110-L111

kind: 'column',
columnTypes: ['number', 'string'],

static/app/views/dashboards/datasetConfig/spans.tsx#L274-L285

);
return {...baseFieldOptions, ...spanTags};
}
function _isNotNumericTag(option: FieldValueOption) {
// Filter out numeric tags from primary options, they only show up in
// the parameter fields for aggregate functions
if ('dataType' in option.value.meta) {
return option.value.meta.dataType !== 'number';
}
return true;

Fix in Cursor Fix in Web


return aggregation === AggregationKey.COUNT_UNIQUE
? {...storedNumberTags, ...storedStringTags}
: storedNumberTags;
}, [aggregation, storedNumberTags, storedStringTags]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Tag Merging Overwrites Numeric Attributes

For COUNT_UNIQUE aggregations, merging storedNumberTags and storedStringTags with object spread causes string attributes to overwrite numeric ones when keys conflict. This makes numeric variants of attributes unavailable for selection, potentially breaking related functionality.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant