Skip to content

feat(explore) Adding count_unique, last_seen columns to occurrences dataset#110742

Merged
manessaraj merged 4 commits intomasterfrom
sarajmanes/feat/more-aggregate-functions-for-occurrences-dataset
Mar 23, 2026
Merged

feat(explore) Adding count_unique, last_seen columns to occurrences dataset#110742
manessaraj merged 4 commits intomasterfrom
sarajmanes/feat/more-aggregate-functions-for-occurrences-dataset

Conversation

@manessaraj
Copy link
Contributor

Adds integration tests for the new occurrences EAP dataset on
/api/0/organizations/{org}/events/ and /events-stats/ endpoints,
introduced in #109727.

Add count_unique() and last_seen() columns for occurrences.

…ataset (#110540)

    Adds integration tests for the new occurrences EAP dataset on
    /api/0/organizations/{org}/events/ and /events-stats/ endpoints,
    introduced in #109727.

    Add `count_unique()` and `last_seen()` columns for occurrences.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 16, 2026
@manessaraj manessaraj marked this pull request as ready for review March 16, 2026 18:11
@manessaraj manessaraj requested a review from a team as a code owner March 16, 2026 18:11
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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

default_arg="timestamp",
)
],
),
Copy link
Contributor

Choose a reason for hiding this comment

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

last_seen missing datetime processor returns raw float

Medium Severity

The last_seen aggregate definition lacks a processor=datetime_processor, so it returns a raw Unix timestamp float instead of an ISO-8601 date string. The EAP timestamp column in common_columns.py uses datetime_processor to convert its raw double value, and the non-EAP last_seen() definition returns a "date" type. Additionally, last_seen() is registered as a date_key in event_search.py. Without the processor, consumers expecting a formatted date string will receive a raw number, likely causing display issues in the UI.

Fix in Cursor Fix in Web

)
],
),
"count_unique": count_unique_aggregate_definition(),
Copy link
Member

Choose a reason for hiding this comment

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

nice

Comment on lines +151 to +153
with self.options(
{EAPOccurrencesComparator._callsite_allowlist_option_name(): self.callsite_name}
):
Copy link
Member

Choose a reason for hiding this comment

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

nit: this is on me cause i didn't do it in the initial PR but can we move this to do_request so when we don't need this option anymore we only have to update one spot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do, I have bunch more test and changes coming in. Will take care of it there.

@manessaraj manessaraj merged commit 9341a94 into master Mar 23, 2026
60 checks passed
@manessaraj manessaraj deleted the sarajmanes/feat/more-aggregate-functions-for-occurrences-dataset branch March 23, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants