Skip to content

Conversation

@wmak
Copy link
Member

@wmak wmak commented Oct 21, 2021

wmak added 2 commits October 20, 2021 21:19
- This enables the use of a new TimeseriesQueryBuilder on event-stats
  queries that don't include comparsion, and aren't top events queries
- Had to refactor a lot of the tests to use the same `do_request`
  pattern from eventsv2 to make testing easier
- Needed to add a 4th list to resolve_equation_list so we could
  differentiate easily between equations that are on functions or not
  - Didn't go with a class or namedtuple in the response since we'll
    likely be removing some of this once we're done migrating
- Only adding project_threshold_config when auto_fields are on, which
  means that the table response is unchanged, but now we no longer need
  to do the averaging for graphing threshold based functions
- This introduces a bulk_snql_query function to run both queries
  together
- Mostly copy paste of the comparison code
  - Did add an additional check that comparison_delta was set just for
    safety 🤷
@wmak wmak requested review from a team as code owners October 21, 2021 18:46
@wmak wmak requested a review from wedamija October 21, 2021 18:46
Copy link
Member

@evanh evanh left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment on lines +818 to +826
response = self.do_request(
data={
"start": iso_format(self.day_ago),
"end": iso_format(self.day_ago + timedelta(hours=2)),
"interval": "1h",
"comparisonDelta": "17h",
},
)
assert response.status_code == 400, response.content
Copy link
Member

Choose a reason for hiding this comment

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

Confused about why we'd switch away from using get_error_response/get_success_response here and elsewhere? It results in more lines/duplication with the status code checking

Copy link
Member Author

@wmak wmak Oct 22, 2021

Choose a reason for hiding this comment

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

Agreed that those are the better test functions, but the reason I switched to the do_request method here is to make having the duplicate snql tests that OrganizationEventsStatsEndpointTestWithSnql provide easier to write

Base automatically changed from wmak/feat/snql-event-stats-simple to master October 25, 2021 15:18
@wmak wmak requested a review from a team October 25, 2021 15:18
@wmak wmak enabled auto-merge (squash) October 25, 2021 15:40
@wmak wmak merged commit 6075b4d into master Oct 25, 2021
@wmak wmak deleted the wmak/feat/snql-event-stats-comparison branch October 25, 2021 15:56
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants