Browse Source

feat(replays): Allow is-archived values be null or 0 in tag look up (#54638)

Fixes: https://github.com/getsentry/snuba/pull/4598
Colton Allen 1 year ago
parent
commit
7085f47223
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/sentry/replays/query.py

+ 7 - 1
src/sentry/replays/query.py

@@ -16,6 +16,7 @@ from snuba_sdk import (
     Limit,
     Limit,
     Offset,
     Offset,
     Op,
     Op,
+    Or,
     Query,
     Query,
     Request,
     Request,
 )
 )
@@ -392,7 +393,12 @@ def query_replays_dataset_tagkey_values(
                 Condition(Column("project_id"), Op.IN, project_ids),
                 Condition(Column("project_id"), Op.IN, project_ids),
                 Condition(Column("timestamp"), Op.LT, end),
                 Condition(Column("timestamp"), Op.LT, end),
                 Condition(Column("timestamp"), Op.GTE, start),
                 Condition(Column("timestamp"), Op.GTE, start),
-                Condition(Column("is_archived"), Op.IS_NULL),
+                Or(
+                    [
+                        Condition(Column("is_archived"), Op.EQ, 0),
+                        Condition(Column("is_archived"), Op.IS_NULL),
+                    ]
+                ),
                 *where,
                 *where,
             ],
             ],
             orderby=[OrderBy(Column("times_seen"), Direction.DESC)],
             orderby=[OrderBy(Column("times_seen"), Direction.DESC)],