File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/sentry/tagstore/snuba
tests/sentry/issues/endpoints Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -749,6 +749,12 @@ def get_group_tag_keys_and_top_values(
749749 ]
750750 values_by_key [k ] = {vk : vd for vk , vd in sorted_items }
751751
752+ # Increase the count of the key by the count of empty values
753+ for keyobj in keys_with_counts :
754+ stats = empty_stats_map .get (keyobj .key )
755+ if stats and stats .get ("count" , 0 ) > 0 :
756+ keyobj .count = (keyobj .count or 0 ) + stats ["count" ]
757+
752758 for keyobj in keys_with_counts :
753759 key = keyobj .key
754760 values = values_by_key .get (key , dict ())
Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ def test_include_empty_values_for_specific_key_with_feature(self) -> None:
341341 values = {v ["value" ] for v in response .data [0 ]["topValues" ]}
342342 assert values == {"" , "bar" }
343343 assert response .data [0 ]["topValues" ][0 ]["count" ] == 1
344+ assert response .data [0 ]["totalValues" ] == 2
344345
345346 def test_include_empty_values_in_all_tags_with_feature (self ) -> None :
346347 event = self .store_event (
@@ -378,6 +379,7 @@ def test_include_empty_values_in_all_tags_with_feature(self) -> None:
378379 foo = next ((t for t in response .data if t ["key" ] == "foo" ), None )
379380 assert foo is not None
380381 assert {v ["value" ] for v in foo ["topValues" ]} == {"" , "bar" }
382+ assert foo ["totalValues" ] == 2
381383
382384 def test_flags (self ) -> None :
383385 event1 = self .store_event (
You can’t perform that action at this time.
0 commit comments