Skip to content

Commit 09d3c49

Browse files
authored
feat: Add versioning to dashboards dataset split (#78709)
Adds versioning to dataset source so we can re-run widgets Requires getsentry/getsentry#15303
1 parent 9772f9a commit 09d3c49

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/sentry/discover/dashboard_widget_split.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def _get_and_save_split_decision_for_dashboard_widget(
138138
_save_split_decision_for_widget(
139139
widget,
140140
widget_dataset,
141-
DatasetSourcesTypes.INFERRED,
141+
DatasetSourcesTypes.SPLIT_VERSION_1,
142142
)
143143
return widget_dataset, False
144144

@@ -169,7 +169,7 @@ def _get_and_save_split_decision_for_dashboard_widget(
169169
_save_split_decision_for_widget(
170170
widget,
171171
DashboardWidgetTypes.TRANSACTION_LIKE,
172-
DatasetSourcesTypes.INFERRED,
172+
DatasetSourcesTypes.SPLIT_VERSION_1,
173173
)
174174

175175
return DashboardWidgetTypes.TRANSACTION_LIKE, True
@@ -213,7 +213,7 @@ def _get_and_save_split_decision_for_dashboard_widget(
213213
_save_split_decision_for_widget(
214214
widget,
215215
DashboardWidgetTypes.ERROR_EVENTS,
216-
DatasetSourcesTypes.INFERRED,
216+
DatasetSourcesTypes.SPLIT_VERSION_1,
217217
)
218218
return DashboardWidgetTypes.ERROR_EVENTS, True
219219

@@ -246,7 +246,7 @@ def _get_and_save_split_decision_for_dashboard_widget(
246246
_save_split_decision_for_widget(
247247
widget,
248248
DashboardWidgetTypes.TRANSACTION_LIKE,
249-
DatasetSourcesTypes.INFERRED,
249+
DatasetSourcesTypes.SPLIT_VERSION_1,
250250
)
251251

252252
return DashboardWidgetTypes.TRANSACTION_LIKE, True

src/sentry/models/dashboard_widget.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ class DatasetSourcesTypes(Enum):
9696
Was an ambiguous dataset forced to split (i.e. we picked a default)
9797
"""
9898
FORCED = 3
99+
"""
100+
Dataset inferred by split querscript, version 1
101+
"""
102+
SPLIT_VERSION_1 = 4
99103

100104
@classmethod
101105
def as_choices(cls):

0 commit comments

Comments
 (0)