Skip to content

[DRAFT] Remove query_builder from mypy typing-issues list#119028

Draft
cursor[bot] wants to merge 3 commits into
masterfrom
cursor/untyped-module-cleanup-f03a
Draft

[DRAFT] Remove query_builder from mypy typing-issues list#119028
cursor[bot] wants to merge 3 commits into
masterfrom
cursor/untyped-module-cleanup-f03a

Conversation

@cursor

@cursor cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • removed sentry.snuba.metrics.query_builder from the tool.mypy.overrides "sentry modules with typing issues" list in pyproject.toml
  • fixed strict typing issues in src/sentry/snuba/metrics/query_builder.py (type narrowing, optional handling, and typed parameter casting)
  • kept behavior unchanged while making the module pass strict mypy checks

Testing

  • .venv/bin/python -m mypy src/sentry/snuba/metrics/query_builder.py
  • .venv/bin/prek run -q
  • make test-selective (fails in this environment: gcloud unavailable)
  • SENTRY_SKIP_SERVICE_VALIDATION=1 .venv/bin/pytest -n3 -svv --reuse-db tests/sentry/snuba/metrics/test_query_builder.py (fails in this environment due unavailable Redis/Postgres services)

Reviewers

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Open in Web View Automation 

cursoragent and others added 3 commits July 4, 2026 12:05
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 4, 2026
Comment on lines +130 to +134
operation, metric_name = parse_expression(field)
if operation is not None and operation not in OPERATIONS:
raise InvalidParams(f"Invalid operation '{operation}'. Must be one of {', '.join(OPERATIONS)}")

if matches is not None:
operation = matches[1]
metric_name = matches[2]
else:
operation = None
metric_name = field
return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

parse_public_field uses MRI regex instead of public-name regex, breaking all public metric field parsing

Replacing PUBLIC_EXPRESSION_REGEX.match(field) with parse_expression(field) is incorrect: parse_expression uses MRI_EXPRESSION_REGEX which requires MRI format (entity:namespace/name@unit), so public fields like sum(session.duration) never match, causing operation=None and metric_name="sum(session.duration)", which then fails inside get_mri() with InvalidParams("Failed to parse 'sum(session.duration)'") for every API call with a public metric field.

Evidence
  • parse_expression in naming_layer/mapping.py:116 uses MRI_EXPRESSION_REGEX, whose pattern is ^{OP_REGEX}\(({MRI_SCHEMA_REGEX_STRING})\)- parse_expressioninnaming_layer/mapping.py:116usesMRI_EXPRESSION_REGEX, whose pattern is where MRI_SCHEMA_REGEX_STRING=entity:namespace/name@unit` — requires colons and at-sign.
  • A public field like sum(session.duration) does not match MRI_EXPRESSION_REGEX; parse_expression returns (None, "sum(session.duration)").
  • operation is None, so the InvalidParams guard on line 131 is skipped; get_mri("sum(session.duration)") raises InvalidParams("Failed to parse 'sum(session.duration)'…") via KeyError in NAME_TO_MRI lookup.
  • The old code used PUBLIC_EXPRESSION_REGEX (^{OP_REGEX}\({PUBLIC_NAME_REGEX}\)- parse_expressioninnaming_layer/mapping.py:116usesMRI_EXPRESSION_REGEX, whose pattern is ^{OP_REGEX}(({MRI_SCHEMA_REGEX_STRING}))- parse_expression in naming_layer/mapping.py:116 uses MRI_EXPRESSION_REGEX, whose pattern is where MRI_SCHEMA_REGEX_STRING = entity:namespace/name@unit — requires colons and at-sign.
  • A public field like sum(session.duration) does not match MRI_EXPRESSION_REGEX; parse_expression returns (None, "sum(session.duration)").
  • operation is None, so the InvalidParams guard on line 131 is skipped; get_mri("sum(session.duration)") raises InvalidParams("Failed to parse 'sum(session.duration)'…") via KeyError in NAME_TO_MRI lookup.
  • The old code used PUBLIC_EXPRESSION_REGEX () which correctly matches session.duration as a plain dotted public name, extracting operation="sum" and metric_name="session.duration".
  • parse_field is called directly from user API query params (query_params.getlist("field", [])) at line 530, so every metrics API request using a public field with an operation hits this path.

Identified by Warden sentry-backend-bugs · 788-XYR

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on 5933df3 in this run:

tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_groupby_session_statuslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:105: in test_groupby_session_status
    assert response.data["detail"] == (
E   AssertionError: assert ErrorDetail(s...'parse_error') == 'Tag name ses...groupBy query'
E     
E     �[0m�[91m- Tag name session.status cannot be used in groupBy query�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_multi_field_orderbylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:640: in test_multi_field_orderby
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_transaction_status_unknown_errorlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1534: in test_transaction_status_unknown_error
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_incorrect_use_case_id_valuelog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:74: in test_incorrect_use_case_id_value
    assert response.data["detail"] == "The supplied use case doesn't exist or it's private"
E   assert ErrorDetail(s...'parse_error') == "The supplied... it's private"
E     
E     �[0m�[91m- The supplied use case doesn't exist or it's private�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_incorrect_crash_free_ratelog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1759: in test_incorrect_crash_free_rate
    assert (response.data["detail"]) == (
E   AssertionError: assert ErrorDetail(s...'parse_error') == 'Failed to pa...pplied to it.'
E     
E     �[0m�[91m- Failed to parse sum(session.crash_free_rate). No operations can be applied on this field as it is already a derived metric with an aggregation applied to it.�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(session.crash_free_rate)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_separate_projectslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:551: in test_separate_projects
    assert count_sessions(project_id=None) == 2
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/sentry/releases/endpoints/test_organization_release_health_data.py:544: in count_sessions
    response = self.get_success_response(self.organization.slug, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_max_and_min_on_distributionslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:564: in test_max_and_min_on_distributions
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_one_field_orderby_with_no_groupby_returns_one_rowlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1168: in test_one_field_orderby_with_no_groupby_returns_one_row
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderby_percentile_with_many_fields_multiple_entities_with_missing_datalog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1202: in test_orderby_percentile_with_many_fields_multiple_entities_with_missing_data
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_series_are_limited_to_total_order_in_case_with_one_field_orderbylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1141: in test_series_are_limited_to_total_order_in_case_with_one_field_orderby
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_validate_include_meta_not_enabled_by_defaultlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:157: in test_validate_include_meta_not_enabled_by_default
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_errored_rate_sessions_and_userslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:2567: in test_errored_rate_sessions_and_users
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/snuba/metrics/test_query_builder.py::test_build_snuba_query_orderbylog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
src/sentry/snuba/metrics/naming_layer/mapping.py:65: in get_mri
    return cast(str, NAME_TO_MRI[external_name].value)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   KeyError: 'sum(sentry.sessions.session)'

During handling of the above exception, another exception occurred:
tests/sentry/snuba/metrics/test_query_builder.py:748: in test_build_snuba_query_orderby
    query_definition = QueryDefinition(
src/sentry/snuba/metrics/query_builder.py:530: in __init__
    parse_field(
src/sentry/snuba/metrics/query_builder.py:126: in parse_field
    return parse_public_field(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:134: in parse_public_field
    return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))
                                                                    ^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/naming_layer/mapping.py:67: in get_mri
    raise InvalidParams(
E   sentry.exceptions.InvalidParams: Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.
tests/sentry/snuba/metrics/test_metrics_layer/test_release_health.py::ReleaseHealthMetricsLayerTestCase::test_valid_filter_include_metalog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
src/sentry/snuba/metrics/naming_layer/mapping.py:65: in get_mri
    return cast(str, NAME_TO_MRI[external_name].value)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   KeyError: 'sum(sentry.sessions.session)'

During handling of the above exception, another exception occurred:
tests/sentry/snuba/metrics/test_metrics_layer/test_release_health.py:50: in test_valid_filter_include_meta
    query = QueryDefinition([self.project], query_params)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:530: in __init__
    parse_field(
src/sentry/snuba/metrics/query_builder.py:126: in parse_field
    return parse_public_field(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:134: in parse_public_field
    return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))
                                                                    ^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/naming_layer/mapping.py:67: in get_mri
    raise InvalidParams(
E   sentry.exceptions.InvalidParams: Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.
tests/sentry/snuba/metrics/test_query_builder.py::QueryDefinitionTestCase::test_single_environment_is_passed_through_to_metrics_querylog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
src/sentry/snuba/metrics/naming_layer/mapping.py:65: in get_mri
    return cast(str, NAME_TO_MRI[external_name].value)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   KeyError: 'sum(sentry.sessions.session)'

During handling of the above exception, another exception occurred:
tests/sentry/snuba/metrics/test_query_builder.py:1538: in test_single_environment_is_passed_through_to_metrics_query
    query = QueryDefinition([self.project], query_params)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:530: in __init__
    parse_field(
src/sentry/snuba/metrics/query_builder.py:126: in parse_field
    return parse_public_field(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:134: in parse_public_field
    return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))
                                                                    ^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/naming_layer/mapping.py:67: in get_mri
    raise InvalidParams(
E   sentry.exceptions.InvalidParams: Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_filter_by_single_project_sluglog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:362: in test_filter_by_single_project_slug
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_groupby_projectlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1384: in test_groupby_project
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderbylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:601: in test_orderby
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderby_percentilelog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:688: in test_orderby_percentile
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_request_too_granularlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1494: in test_request_too_granular
    assert response.data["detail"] == (
E   AssertionError: assert ErrorDetail(s...'parse_error') == 'Requested in...ge parameter.'
E     
E     �[0m�[91m- Requested intervals (288) of timedelta of 0:05:00 with statsPeriod timedelta of 1 day, 0:00:00 is too granular for a per_page of 51 elements. Increase your interval, decrease your statsPeriod, or decrease your per_page parameter.�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/snuba/metrics/test_query_builder.py::test_build_snuba_query_with_derived_aliaslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
src/sentry/snuba/metrics/naming_layer/mapping.py:65: in get_mri
    return cast(str, NAME_TO_MRI[external_name].value)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   KeyError: 'p95(session.duration)'

During handling of the above exception, another exception occurred:
tests/sentry/snuba/metrics/test_query_builder.py:850: in test_build_snuba_query_with_derived_alias
    query_definition = QueryDefinition(
src/sentry/snuba/metrics/query_builder.py:530: in __init__
    parse_field(
src/sentry/snuba/metrics/query_builder.py:126: in parse_field
    return parse_public_field(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:134: in parse_public_field
    return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))
                                                                    ^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/naming_layer/mapping.py:67: in get_mri
    raise InvalidParams(
E   sentry.exceptions.InvalidParams: Failed to parse 'p95(session.duration)'. The metric name must belong to a public metric.
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_include_serieslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1506: in test_include_series
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_no_limit_with_serieslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1448: in test_no_limit_with_series
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderby_percentile_with_many_fields_multiple_entities_with_paginatorlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1073: in test_orderby_percentile_with_many_fields_multiple_entities_with_paginator
    response = self.get_success_response(self.organization.slug, **request_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_valid_filterlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:144: in test_valid_filter
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_filter_session_statuslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:126: in test_filter_session_status
    assert response.data["detail"] == ("Tag name session.status is not a valid query filter")
E   AssertionError: assert ErrorDetail(s...'parse_error') == 'Tag name ses... query filter'
E     
E     �[0m�[91m- Tag name session.status is not a valid query filter�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_limit_without_orderbylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1254: in test_limit_without_orderby
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_multi_field_orderby_percentile_with_many_fields_one_entitylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:910: in test_multi_field_orderby_percentile_with_many_fields_one_entity
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_unhandled_rate_sessions_and_userslog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:2614: in test_unhandled_rate_sessions_and_users
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_limit_without_orderby_excess_groups_prunedlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1310: in test_limit_without_orderby_excess_groups_pruned
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_interval_should_divide_day_with_no_remainderlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:220: in test_interval_should_divide_day_with_no_remainder
    assert response.data["detail"] == (
E   AssertionError: assert ErrorDetail(s...'parse_error') == 'The interval... a remainder.'
E     
E     �[0m�[91m- The interval should divide one day without a remainder.�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_limit_with_orderby_is_overridden_by_paginator_limitlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:773: in test_limit_with_orderby_is_overridden_by_paginator_limit
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderby_percentile_with_paginationlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:726: in test_orderby_percentile_with_pagination
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_date_range_too_longlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:193: in test_date_range_too_long
    assert response.data["detail"] == (
E   AssertionError: assert ErrorDetail(s...'parse_error') == 'Your interva...r date range.'
E     
E     �[0m�[91m- Your interval and date range would create too many results. Use a larger interval, or a smaller date range.�[39;49;00m�[90m�[39;49;00m
E     �[92m+ Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.�[39;49;00m�[90m�[39;49;00m
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_crash_free_rate_when_no_session_metrics_data_existlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1721: in test_crash_free_rate_when_no_session_metrics_data_exist
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_metric_without_operation_is_not_allowedlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:2487: in test_metric_without_operation_is_not_allowed
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_session_duration_derived_aliaslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:2345: in test_session_duration_derived_alias
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_filter_by_project_slug_negationlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:291: in test_filter_by_project_slug_negation
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_filter_by_single_project_slug_negationlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:396: in test_filter_by_single_project_slug_negation
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderby_percentile_with_many_fields_one_entity_no_datalog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:796: in test_orderby_percentile_with_many_fields_one_entity_no_data
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_pagination_limit_without_orderbylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:473: in test_pagination_limit_without_orderby
    self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_pagination_offset_without_orderbylog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:509: in test_pagination_offset_without_orderby
    self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/snuba/metrics/test_query_builder.py::test_translate_results_missing_slotslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
src/sentry/snuba/metrics/naming_layer/mapping.py:65: in get_mri
    return cast(str, NAME_TO_MRI[external_name].value)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   KeyError: 'sum(sentry.sessions.session)'

During handling of the above exception, another exception occurred:
tests/sentry/snuba/metrics/test_query_builder.py:1093: in test_translate_results_missing_slots
    query_definition = QueryDefinition([PseudoProject(1, 1)], query_params)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:530: in __init__
    parse_field(
src/sentry/snuba/metrics/query_builder.py:126: in parse_field
    return parse_public_field(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:134: in parse_public_field
    return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))
                                                                    ^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/naming_layer/mapping.py:67: in get_mri
    raise InvalidParams(
E   sentry.exceptions.InvalidParams: Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.
tests/sentry/snuba/metrics/test_query_builder.py::QueryDefinitionTestCase::test_multiple_environments_are_passed_through_to_metrics_querylog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
src/sentry/snuba/metrics/naming_layer/mapping.py:65: in get_mri
    return cast(str, NAME_TO_MRI[external_name].value)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   KeyError: 'sum(sentry.sessions.session)'

During handling of the above exception, another exception occurred:
tests/sentry/snuba/metrics/test_query_builder.py:1560: in test_multiple_environments_are_passed_through_to_metrics_query
    query = QueryDefinition([self.project], query_params)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:530: in __init__
    parse_field(
src/sentry/snuba/metrics/query_builder.py:126: in parse_field
    return parse_public_field(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/query_builder.py:134: in parse_public_field
    return MetricField(cast(MetricOperationType | None, operation), get_mri(metric_name))
                                                                    ^^^^^^^^^^^^^^^^^^^^
src/sentry/snuba/metrics/naming_layer/mapping.py:67: in get_mri
    raise InvalidParams(
E   sentry.exceptions.InvalidParams: Failed to parse 'sum(sentry.sessions.session)'. The metric name must belong to a public metric.
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_filter_by_project_sluglog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:249: in test_filter_by_project_slug
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_groupby_singlelog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:82: in test_groupby_single
    self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_orderby_percentile_with_many_fields_multiple_entitieslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:996: in test_orderby_percentile_with_many_fields_multiple_entities
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_unknown_filterlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1472: in test_unknown_filter
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_group_by_projectlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:438: in test_group_by_project
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_staff_filter_by_single_project_sluglog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:328: in test_staff_filter_by_single_project_slug
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::OrganizationReleaseHealthDataTest::test_unknown_groupbylog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1414: in test_unknown_groupby
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/releases/endpoints/test_organization_release_health_data.py::DerivedMetricsDataTest::test_crash_free_rate_when_no_session_metrics_data_with_orderby_and_groupbylog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/releases/endpoints/test_organization_release_health_data.py:1736: in test_crash_free_rate_when_no_session_metrics_data_with_orderby_and_groupby
    response = self.get_success_response(
src/sentry/testutils/cases.py:629: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
src/sentry/testutils/asserts.py:46: in assert_status_code
    assert minimum <= response.status_code < maximum, response
E   AssertionError: <Response status_code=400, "application/json">
E   assert 400 < 201
E    +  where 400 = <Response status_code=400, "application/json">.status_code

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.

1 participant