Skip to content

feat(data-explore): Add new Query type for full export for simpler request validation#112953

Merged
manessaraj merged 5 commits intomasterfrom
sarajmanes/feat/trace-items-full-export-new-query-type
Apr 15, 2026
Merged

feat(data-explore): Add new Query type for full export for simpler request validation#112953
manessaraj merged 5 commits intomasterfrom
sarajmanes/feat/trace-items-full-export-new-query-type

Conversation

@manessaraj
Copy link
Copy Markdown
Contributor

Create new Query type for full export of trace items for simpler query validation.

@manessaraj manessaraj requested a review from a team as a code owner April 14, 2026 17:50
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 14, 2026
Comment thread src/sentry/data_export/endpoints/data_export.py
Comment thread src/sentry/data_export/endpoints/data_export.py
Comment thread src/sentry/data_export/endpoints/data_export.py
Comment thread src/sentry/data_export/endpoints/data_export.py
Comment thread src/sentry/data_export/endpoints/data_export.py
Comment thread src/sentry/data_export/tasks.py
Comment thread src/sentry/data_export/endpoints/data_export.py
@github-actions
Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on a4e71cf in this run:

tests/sentry/data_export/endpoints/test_data_export.py::DataExportTest::test_new_exportlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/data_export/endpoints/test_data_export.py:89: in test_new_export
    assert response.data == {
E   AssertionError: assert {'checksum': ...d': None, ...} == {'checksum': ...d': None, ...}
E     
E     Omitting 9 identical items, use -vv to show
E     Left contains 1 more item:
E     {'export_format': 'csv'}
E     
E     Full diff:
E       {
E           'checksum': None,
E           'dateCreated': datetime.datetime(2026, 4, 15, 15, 50, 8, 998854, tzinfo=datetime.timezone.utc),
E           'dateExpired': None,
E           'dateFinished': None,
E     +     'export_format': 'csv',
E           'fileName': None,
E           'id': 27,
E           'query': {
E               'info': {
E                   'env': 'test',
E                   'project': [
E                       4557972867907616,
E                   ],
E               },
E               'type': 'Issues-by-Tag',
E           },
E           'status': <ExportStatus.Early: 'EARLY'>,
E           'user': {
E               'email': 'user1@example.com',
E               'id': '38',
E               'username': 'user1@example.com',
E           },
E       }
tests/sentry/data_export/endpoints/test_data_export.py::DataExportTest::test_progress_exportlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/data_export/endpoints/test_data_export.py:119: in test_progress_export
    assert response2.data == {
E   AssertionError: assert {'checksum': ...d': None, ...} == {'checksum': ...d': None, ...}
E     
E     Omitting 9 identical items, use -vv to show
E     Left contains 1 more item:
E     {'export_format': 'csv'}
E     
E     Full diff:
E       {
E           'checksum': None,
E           'dateCreated': datetime.datetime(2026, 4, 15, 15, 50, 14, 93074, tzinfo=datetime.timezone.utc),
E           'dateExpired': None,
E           'dateFinished': None,
E     +     'export_format': 'csv',
E           'fileName': None,
E           'id': 34,
E           'query': {
E               'info': {
E                   'env': 'test',
E                   'project': [
E                       4557972868235296,
E                   ],
E               },
E               'type': 'Issues-by-Tag',
E           },
E           'status': <ExportStatus.Early: 'EARLY'>,
E           'user': {
E               'email': 'user1@example.com',
E               'id': '45',
E               'username': 'user1@example.com',
E           },
E       }

Copy link
Copy Markdown
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 2 potential issues.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit d43ba64. Configure here.

"status": obj.status,
"checksum": checksum,
"fileName": file_name,
"export_format": obj.export_format,
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.

API response field uses inconsistent naming convention

Medium Severity

The new export_format key uses snake_case, while every other multi-word key in this serializer response uses camelCase (dateCreated, dateFinished, dateExpired, fileName). This inconsistency will be visible to API consumers and breaks the established naming convention. It likely needs to be "exportFormat" to match the rest of the response.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d43ba64. Configure here.

run_sync = (
limit is not None
and limit <= MAX_SYNC_LIMIT
and data["query_type"] == ExportQueryType.EXPLORE_STR
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.

Sync execution removed for EXPLORE queries on logs

Low Severity

The run_sync condition was changed from EXPLORE_STR to only TRACE_ITEM_FULL_EXPORT_STR, which means regular EXPLORE queries on the logs dataset with a small limit no longer run synchronously. Elsewhere in this PR, when behavior was shared between the two types, both were included (e.g., feature checks, dataset validation, sort handling). This replacement instead of addition looks inconsistent with the rest of the PR's pattern.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d43ba64. Configure here.

@manessaraj manessaraj merged commit b4dbfb0 into master Apr 15, 2026
56 checks passed
@manessaraj manessaraj deleted the sarajmanes/feat/trace-items-full-export-new-query-type branch April 15, 2026 18:41
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