@@ -1996,7 +1996,7 @@ def test_p75_if(self) -> None:
1996
1996
1997
1997
response = self .do_request (
1998
1998
{
1999
- "field" : ["p75_if(span.duration, is_transaction, true)" ],
1999
+ "field" : ["p75_if(span.duration, is_transaction, equals, true)" ],
2000
2000
"query" : "" ,
2001
2001
"project" : self .project .id ,
2002
2002
"dataset" : "spans" ,
@@ -2009,12 +2009,15 @@ def test_p75_if(self) -> None:
2009
2009
assert len (data ) == 1
2010
2010
assert data == [
2011
2011
{
2012
- "p75_if(span.duration, is_transaction, true)" : 3000 ,
2012
+ "p75_if(span.duration, is_transaction, equals, true)" : 3000 ,
2013
2013
},
2014
2014
]
2015
+
2015
2016
assert meta ["dataset" ] == "spans"
2016
- assert meta ["units" ] == {"p75_if(span.duration, is_transaction, true)" : "millisecond" }
2017
- assert meta ["fields" ] == {"p75_if(span.duration, is_transaction, true)" : "duration" }
2017
+ assert meta ["units" ] == {
2018
+ "p75_if(span.duration, is_transaction, equals, true)" : "millisecond"
2019
+ }
2020
+ assert meta ["fields" ] == {"p75_if(span.duration, is_transaction, equals, true)" : "duration" }
2018
2021
2019
2022
def test_is_transaction (self ) -> None :
2020
2023
self .store_spans (
@@ -2666,7 +2669,7 @@ def test_failure_rate_if(self) -> None:
2666
2669
2667
2670
response = self .do_request (
2668
2671
{
2669
- "field" : ["failure_rate_if(is_transaction, true)" ],
2672
+ "field" : ["failure_rate_if(is_transaction, equals, true)" ],
2670
2673
"project" : self .project .id ,
2671
2674
"dataset" : "spans" ,
2672
2675
}
@@ -2676,13 +2679,13 @@ def test_failure_rate_if(self) -> None:
2676
2679
data = response .data ["data" ]
2677
2680
meta = response .data ["meta" ]
2678
2681
assert len (data ) == 1
2679
- assert data [0 ]["failure_rate_if(is_transaction, true)" ] == 0.25
2682
+ assert data [0 ]["failure_rate_if(is_transaction, equals, true)" ] == 0.25
2680
2683
assert meta ["dataset" ] == "spans"
2681
2684
assert meta ["fields" ] == {
2682
- "failure_rate_if(is_transaction, true)" : "percentage" ,
2685
+ "failure_rate_if(is_transaction, equals, true)" : "percentage" ,
2683
2686
}
2684
2687
assert meta ["units" ] == {
2685
- "failure_rate_if(is_transaction, true)" : None ,
2688
+ "failure_rate_if(is_transaction, equals, true)" : None ,
2686
2689
}
2687
2690
2688
2691
def test_count_op (self ) -> None :
@@ -2750,8 +2753,8 @@ def test_avg_if(self) -> None:
2750
2753
response = self .do_request (
2751
2754
{
2752
2755
"field" : [
2753
- "avg_if(span.duration, span.op, queue.process)" ,
2754
- "avg_if(span.duration, span.op, queue.publish)" ,
2756
+ "avg_if(span.duration, span.op, equals, queue.process)" ,
2757
+ "avg_if(span.duration, span.op, equals, queue.publish)" ,
2755
2758
],
2756
2759
"project" : self .project .id ,
2757
2760
"dataset" : "spans" ,
@@ -2762,8 +2765,8 @@ def test_avg_if(self) -> None:
2762
2765
data = response .data ["data" ]
2763
2766
meta = response .data ["meta" ]
2764
2767
assert len (data ) == 1
2765
- assert data [0 ]["avg_if(span.duration, span.op, queue.process)" ] == 1500.0
2766
- assert data [0 ]["avg_if(span.duration, span.op, queue.publish)" ] == 3000.0
2768
+ assert data [0 ]["avg_if(span.duration, span.op, equals, queue.process)" ] == 1500.0
2769
+ assert data [0 ]["avg_if(span.duration, span.op, equals, queue.publish)" ] == 3000.0
2767
2770
assert meta ["dataset" ] == "spans"
2768
2771
2769
2772
def test_avg_compare (self ) -> None :
@@ -2818,7 +2821,7 @@ def test_avg_if_invalid_param(self) -> None:
2818
2821
response = self .do_request (
2819
2822
{
2820
2823
"field" : [
2821
- "avg_if(span.duration, span.duration, queue.process)" ,
2824
+ "avg_if(span.duration, span.duration, equals, queue.process)" ,
2822
2825
],
2823
2826
"project" : self .project .id ,
2824
2827
"dataset" : "spans" ,
@@ -3107,8 +3110,8 @@ def test_division_if(self) -> None:
3107
3110
response = self .do_request (
3108
3111
{
3109
3112
"field" : [
3110
- "division_if(mobile.slow_frames,mobile.total_frames,browser.name,Chrome)" ,
3111
- "division_if(mobile.slow_frames,mobile.total_frames,browser.name,Firefox)" ,
3113
+ "division_if(mobile.slow_frames,mobile.total_frames,browser.name,equals, Chrome)" ,
3114
+ "division_if(mobile.slow_frames,mobile.total_frames,browser.name,equals, Firefox)" ,
3112
3115
],
3113
3116
"project" : self .project .id ,
3114
3117
"dataset" : "spans" ,
@@ -3120,17 +3123,21 @@ def test_division_if(self) -> None:
3120
3123
meta = response .data ["meta" ]
3121
3124
assert len (data ) == 1
3122
3125
assert (
3123
- data [0 ]["division_if(mobile.slow_frames,mobile.total_frames,browser.name,Chrome)" ]
3126
+ data [0 ][
3127
+ "division_if(mobile.slow_frames,mobile.total_frames,browser.name,equals,Chrome)"
3128
+ ]
3124
3129
== 10 / 100
3125
3130
)
3126
3131
assert (
3127
- data [0 ]["division_if(mobile.slow_frames,mobile.total_frames,browser.name,Firefox)" ]
3132
+ data [0 ][
3133
+ "division_if(mobile.slow_frames,mobile.total_frames,browser.name,equals,Firefox)"
3134
+ ]
3128
3135
== 50 / 100
3129
3136
)
3130
3137
assert meta ["dataset" ] == "spans"
3131
3138
assert meta ["fields" ] == {
3132
- "division_if(mobile.slow_frames,mobile.total_frames,browser.name,Chrome)" : "percentage" ,
3133
- "division_if(mobile.slow_frames,mobile.total_frames,browser.name,Firefox)" : "percentage" ,
3139
+ "division_if(mobile.slow_frames,mobile.total_frames,browser.name,equals, Chrome)" : "percentage" ,
3140
+ "division_if(mobile.slow_frames,mobile.total_frames,browser.name,equals, Firefox)" : "percentage" ,
3134
3141
}
3135
3142
3136
3143
def test_total_performance_score (self ) -> None :
@@ -4504,7 +4511,8 @@ def test_typed_attributes_with_colons(self) -> None:
4504
4511
},
4505
4512
]
4506
4513
4507
- def test_count_if_two_args (self ) -> None :
4514
+ def test_count_if_two_args (self ):
4515
+ """count_if should have an operator"""
4508
4516
self .store_spans (
4509
4517
[
4510
4518
self .create_span ({"sentry_tags" : {"release" : "foo" }}),
@@ -4525,13 +4533,7 @@ def test_count_if_two_args(self) -> None:
4525
4533
"dataset" : "spans" ,
4526
4534
}
4527
4535
)
4528
- assert response .status_code == 200 , response .content
4529
- data = response .data ["data" ]
4530
- meta = response .data ["meta" ]
4531
-
4532
- assert len (data ) == 1
4533
- assert data [0 ]["count_if(release,foo)" ] == 1
4534
- assert meta ["dataset" ] == "spans"
4536
+ assert response .status_code == 400 , response .content
4535
4537
4536
4538
def test_span_ops_breakdown (self ) -> None :
4537
4539
self .store_spans (
0 commit comments