@@ -142,12 +142,14 @@ def data_fn(offset: int, limit: int):
142
142
all_projects_params ["projects_objects" ] = all_projects_snuba_params .projects
143
143
all_projects_params ["projects_id" ] = all_projects_snuba_params .project_ids
144
144
145
+ trace_id_condition = Condition (Column ("trace_id" ), Op .IN , trace_ids )
146
+
145
147
with handle_query_errors ():
146
148
breakdowns_query = SpansIndexedQueryBuilder (
147
149
Dataset .SpansIndexed ,
148
150
cast (ParamsType , all_projects_params ),
149
151
snuba_params = all_projects_snuba_params ,
150
- query = None ,
152
+ query = "is_transaction:1" ,
151
153
selected_columns = [
152
154
"trace" ,
153
155
"project" ,
@@ -165,9 +167,7 @@ def data_fn(offset: int, limit: int):
165
167
transform_alias_to_input_format = True ,
166
168
),
167
169
)
168
- # TODO: this should be `is_transaction:1` but there's some
169
- # boolean mapping that's not working for this field
170
- breakdowns_query .add_conditions ([Condition (Column ("is_segment" ), Op .EQ , 1 )])
170
+ breakdowns_query .add_conditions ([trace_id_condition ])
171
171
172
172
with handle_query_errors ():
173
173
traces_meta_query = SpansIndexedQueryBuilder (
@@ -188,6 +188,7 @@ def data_fn(offset: int, limit: int):
188
188
transform_alias_to_input_format = True ,
189
189
),
190
190
)
191
+ traces_meta_query .add_conditions ([trace_id_condition ])
191
192
192
193
sort = serialized .get ("sort" )
193
194
suggested_query = serialized .get ("suggestedQuery" , "" )
@@ -213,17 +214,15 @@ def data_fn(offset: int, limit: int):
213
214
)
214
215
for query_str in query_strs
215
216
]
217
+ for spans_query in spans_queries :
218
+ spans_query .add_conditions ([trace_id_condition ])
216
219
217
220
queries = [
218
221
breakdowns_query ,
219
222
traces_meta_query ,
220
223
* spans_queries ,
221
224
]
222
225
223
- trace_id_condition = Condition (Column ("trace_id" ), Op .IN , trace_ids )
224
- for query in queries :
225
- query .add_conditions ([trace_id_condition ])
226
-
227
226
with handle_query_errors ():
228
227
results = bulk_snql_query (
229
228
[query .get_snql_query () for query in queries ],
0 commit comments