Skip to content

Commit e71ef51

Browse files
committed
Convert boolean tags to strings in Redis and AWS Lambda integrations
1 parent 8c31eff commit e71ef51

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

tests/integrations/aws_lambda/test_aws_lambda.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ def test_non_dict_event(
325325
assert transaction_event["request"] == request_data
326326

327327
if batch_size > 1:
328-
assert error_event["tags"]["batch_size"] == batch_size
329-
assert error_event["tags"]["batch_request"] is True
330-
assert transaction_event["tags"]["batch_size"] == batch_size
331-
assert transaction_event["tags"]["batch_request"] is True
328+
assert error_event["tags"]["batch_size"] == str(batch_size)
329+
assert error_event["tags"]["batch_request"] == "True"
330+
assert transaction_event["tags"]["batch_size"] == str(batch_size)
331+
assert transaction_event["tags"]["batch_request"] == "True"
332332

333333

334334
def test_request_data(lambda_client, test_environment):

tests/integrations/redis/asyncio/test_redis_asyncio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def test_async_basic(sentry_init, capture_events):
2828
"db.operation": "GET",
2929
"redis.key": "foobar",
3030
"redis.command": "GET",
31-
"redis.is_cluster": False,
31+
"redis.is_cluster": "False",
3232
},
3333
"timestamp": crumb["timestamp"],
3434
"type": "redis",
@@ -80,8 +80,8 @@ async def test_async_redis_pipeline(
8080
}
8181
)
8282
assert span["tags"] == {
83-
"redis.transaction": is_transaction,
84-
"redis.is_cluster": False,
83+
"redis.transaction": str(is_transaction),
84+
"redis.is_cluster": "False",
8585
}
8686

8787

tests/integrations/redis/cluster/test_redis_cluster.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_rediscluster_breadcrumb(sentry_init, capture_events):
4646
"db.operation": "GET",
4747
"redis.key": "foobar",
4848
"redis.command": "GET",
49-
"redis.is_cluster": True,
49+
"redis.is_cluster": "True",
5050
},
5151
"timestamp": crumb["timestamp"],
5252
"type": "redis",
@@ -94,7 +94,7 @@ def test_rediscluster_basic(sentry_init, capture_events, send_default_pii, descr
9494
assert span["tags"] == {
9595
"db.operation": "SET",
9696
"redis.command": "SET",
97-
"redis.is_cluster": True,
97+
"redis.is_cluster": "True",
9898
"redis.key": "bar",
9999
}
100100

@@ -141,8 +141,8 @@ def test_rediscluster_pipeline(
141141
}
142142
)
143143
assert span["tags"] == {
144-
"redis.transaction": False, # For Cluster, this is always False
145-
"redis.is_cluster": True,
144+
"redis.transaction": "False", # For Cluster, this is always False
145+
"redis.is_cluster": "True",
146146
}
147147

148148

tests/integrations/redis/cluster_asyncio/test_redis_cluster_asyncio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def test_async_breadcrumb(sentry_init, capture_events):
5353
"db.operation": "GET",
5454
"redis.key": "foobar",
5555
"redis.command": "GET",
56-
"redis.is_cluster": True,
56+
"redis.is_cluster": "True",
5757
}
5858
),
5959
"timestamp": crumb["timestamp"],
@@ -94,7 +94,7 @@ async def test_async_basic(sentry_init, capture_events, send_default_pii, descri
9494
}
9595
)
9696
assert span["tags"] == {
97-
"redis.is_cluster": True,
97+
"redis.is_cluster": "True",
9898
"db.operation": "SET",
9999
"redis.command": "SET",
100100
"redis.key": "bar",
@@ -144,8 +144,8 @@ async def test_async_redis_pipeline(
144144
}
145145
)
146146
assert span["tags"] == {
147-
"redis.transaction": False,
148-
"redis.is_cluster": True,
147+
"redis.transaction": "False",
148+
"redis.is_cluster": "True",
149149
}
150150

151151

tests/integrations/redis/test_redis.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_basic(sentry_init, capture_events):
3434
"data": {
3535
"redis.key": "foobar",
3636
"redis.command": "GET",
37-
"redis.is_cluster": False,
37+
"redis.is_cluster": "False",
3838
"db.operation": "GET",
3939
},
4040
"timestamp": crumb["timestamp"],
@@ -77,8 +77,8 @@ def test_redis_pipeline(
7777
"first_ten": expected_first_ten,
7878
}
7979
assert span["tags"] == {
80-
"redis.transaction": is_transaction,
81-
"redis.is_cluster": False,
80+
"redis.transaction": str(is_transaction),
81+
"redis.is_cluster": "False",
8282
}
8383

8484

@@ -227,7 +227,7 @@ def test_breadcrumbs(sentry_init, capture_events):
227227
"category": "redis",
228228
"data": {
229229
"db.operation": "SET",
230-
"redis.is_cluster": False,
230+
"redis.is_cluster": "False",
231231
"redis.command": "SET",
232232
"redis.key": "somekey1",
233233
},
@@ -239,7 +239,7 @@ def test_breadcrumbs(sentry_init, capture_events):
239239
"category": "redis",
240240
"data": {
241241
"db.operation": "SET",
242-
"redis.is_cluster": False,
242+
"redis.is_cluster": "False",
243243
"redis.command": "SET",
244244
"redis.key": "somekey2",
245245
},

0 commit comments

Comments
 (0)