From 938f1776ae46783fd4f8aec40558c3144fcce634 Mon Sep 17 00:00:00 2001 From: Colton Allen Date: Mon, 10 Jul 2023 08:03:29 -0500 Subject: [PATCH] feat(replays): Ingest null title as null (#4059) * Allow title to be set as null * Update api test --- snuba/datasets/processors/replays_processor.py | 2 +- tests/datasets/test_replays_processor.py | 2 +- tests/test_replays_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/snuba/datasets/processors/replays_processor.py b/snuba/datasets/processors/replays_processor.py index cdde51e0b1..84eb593425 100644 --- a/snuba/datasets/processors/replays_processor.py +++ b/snuba/datasets/processors/replays_processor.py @@ -85,7 +85,7 @@ def _process_tags( # we have to set title to empty string as it is non-nullable, # and on clickhouse 20 this throws an error. - processed["title"] = tags.transaction or "" + processed["title"] = tags.transaction processed["tags.key"] = tags.keys processed["tags.value"] = tags.values diff --git a/tests/datasets/test_replays_processor.py b/tests/datasets/test_replays_processor.py index 617ea59449..41a8e4a6a7 100644 --- a/tests/datasets/test_replays_processor.py +++ b/tests/datasets/test_replays_processor.py @@ -220,7 +220,7 @@ def build_result(self, meta: KafkaMessageMetadata) -> Mapping[str, Any]: "device_model": self.device_model, "tags.key": ["customtag"], "tags.value": ["is_set"], - "title": self.title or "", + "title": self.title, "sdk_name": "sentry.python", "sdk_version": "0.9.0", "retention_days": 30, diff --git a/tests/test_replays_api.py b/tests/test_replays_api.py index 10f700fbe1..661d56c6bd 100644 --- a/tests/test_replays_api.py +++ b/tests/test_replays_api.py @@ -106,7 +106,7 @@ def test_sdk_user_title_nullability(self) -> None: assert data["data"] == [ { - "title": "", + "title": None, "user": None, "sdk_name": None, "sdk_version": None,