From d56323500353aa460ea5297b2ea7de4003397956 Mon Sep 17 00:00:00 2001 From: Volo Kluev Date: Thu, 12 Dec 2024 19:27:48 -0800 Subject: [PATCH 1/2] make mutation condition simpler --- snuba/manual_jobs/scrub_ips_from_spans.py | 1 - 1 file changed, 1 deletion(-) diff --git a/snuba/manual_jobs/scrub_ips_from_spans.py b/snuba/manual_jobs/scrub_ips_from_spans.py index 4b07c074c3..4d87a2f727 100644 --- a/snuba/manual_jobs/scrub_ips_from_spans.py +++ b/snuba/manual_jobs/scrub_ips_from_spans.py @@ -28,7 +28,6 @@ def _get_query(self, cluster_name: str | None) -> str: {on_cluster} UPDATE `sentry_tags.value` = arrayMap((k, v) -> if(k = 'user.ip', 'scrubbed', v), `sentry_tags.key`, `sentry_tags.value`) WHERE project_id IN [{project_ids}] -AND has(`sentry_tags.key`, 'user.ip') AND end_timestamp > toDateTime('{start_datetime}') AND end_timestamp <= toDateTime('{end_datetime}')""" From 89f565bbe2ef3bf3ded1146746ae97794391fd15 Mon Sep 17 00:00:00 2001 From: Volo Kluev Date: Thu, 12 Dec 2024 19:29:27 -0800 Subject: [PATCH 2/2] update tests --- tests/manual_jobs/test_scrub_ips_from_spans.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/manual_jobs/test_scrub_ips_from_spans.py b/tests/manual_jobs/test_scrub_ips_from_spans.py index 2cb4563071..2aba74bd51 100644 --- a/tests/manual_jobs/test_scrub_ips_from_spans.py +++ b/tests/manual_jobs/test_scrub_ips_from_spans.py @@ -87,7 +87,6 @@ def test_generate_query() -> None: UPDATE `sentry_tags.value` = arrayMap((k, v) -> if(k = 'user.ip', 'scrubbed', v), `sentry_tags.key`, `sentry_tags.value`) WHERE project_id IN [1,3,5,6] -AND has(`sentry_tags.key`, 'user.ip') AND end_timestamp > toDateTime('2024-12-01T00:00:00') AND end_timestamp <= toDateTime('2024-12-10T00:00:00')""" ) @@ -98,7 +97,6 @@ def test_generate_query() -> None: ON CLUSTER 'snuba-spans' UPDATE `sentry_tags.value` = arrayMap((k, v) -> if(k = 'user.ip', 'scrubbed', v), `sentry_tags.key`, `sentry_tags.value`) WHERE project_id IN [1,3,5,6] -AND has(`sentry_tags.key`, 'user.ip') AND end_timestamp > toDateTime('2024-12-01T00:00:00') AND end_timestamp <= toDateTime('2024-12-10T00:00:00')""" )