Skip to content

Commit 4948e16

Browse files
committed
clean
1 parent ef873c9 commit 4948e16

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/phoenix/server/api/mutations/span_annotations_mutations.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,8 @@ async def create_span_annotations(
8888
q = select(models.SpanAnnotation).where(
8989
models.SpanAnnotation.span_rowid == span_rowid,
9090
models.SpanAnnotation.name == annotation_input.name,
91+
models.SpanAnnotation.identifier == resolved_identifier,
9192
)
92-
if resolved_identifier is None:
93-
q = q.where(models.SpanAnnotation.identifier.is_(None))
94-
else:
95-
q = q.where(models.SpanAnnotation.identifier == resolved_identifier)
96-
9793
existing_annotation = await session.scalar(q)
9894

9995
if existing_annotation:

src/phoenix/server/api/mutations/trace_annotations_mutations.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,8 @@ async def create_trace_annotations(
8282
q = select(models.TraceAnnotation).where(
8383
models.TraceAnnotation.trace_rowid == trace_rowid,
8484
models.TraceAnnotation.name == annotation_input.name,
85+
models.TraceAnnotation.identifier == resolved_identifier,
8586
)
86-
if resolved_identifier is None:
87-
q = q.where(models.TraceAnnotation.identifier.is_(None))
88-
else:
89-
q = q.where(models.TraceAnnotation.identifier == resolved_identifier)
90-
9187
existing_annotation = await session.scalar(q)
9288

9389
if existing_annotation:

0 commit comments

Comments
 (0)