Skip to content

Commit 7e34714

Browse files
authored
feat(datasets): support json dataset upload via the ui (#7410)
1 parent b45b944 commit 7e34714

10 files changed

+29
-27
lines changed

app/schema.graphql

+1-1
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ input SpanAnnotationFilter {
21542154
input SpanAnnotationFilterCondition {
21552155
names: [String!]
21562156
sources: [AnnotationSource!]
2157-
userIds: [GlobalID!]
2157+
userIds: [GlobalID]
21582158
}
21592159

21602160
type SpanAnnotationMutationPayload {

app/src/components/trace/SpanAnnotationsEditor.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function SpanAnnotationsList(props: {
183183
query SpanAnnotationsEditorSpanAnnotationsListQuery(
184184
$projectId: GlobalID!
185185
$spanId: GlobalID!
186-
$filterUserIds: [GlobalID!]
186+
$filterUserIds: [GlobalID]
187187
) {
188188
project: node(id: $projectId) {
189189
id
@@ -232,13 +232,13 @@ function SpanAnnotationsList(props: {
232232
{
233233
projectId,
234234
spanId,
235-
filterUserIds: viewer?.id ? [viewer.id] : null,
235+
filterUserIds: viewer ? [viewer.id] : [null],
236236
}
237237
);
238238
const span = useFragment<SpanAnnotationsEditor_spanAnnotations$key>(
239239
graphql`
240240
fragment SpanAnnotationsEditor_spanAnnotations on Span
241-
@argumentDefinitions(filterUserIds: { type: "[GlobalID!]" }) {
241+
@argumentDefinitions(filterUserIds: { type: "[GlobalID]" }) {
242242
id
243243
filteredSpanAnnotations: spanAnnotations(
244244
filter: {

app/src/components/trace/__generated__/SpanAnnotationsEditorSpanAnnotationsListQuery.graphql.ts

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/components/trace/__generated__/SpanAnnotationsEditor_spanAnnotations.graphql.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/pages/trace/SpanAside.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function SpanAside(props: SpanAsideProps) {
4040
const data = useFragment<SpanAside_span$key>(
4141
graphql`
4242
fragment SpanAside_span on Span
43-
@argumentDefinitions(filterUserIds: { type: "[GlobalID!]" }) {
43+
@argumentDefinitions(filterUserIds: { type: "[GlobalID]" }) {
4444
id
4545
project {
4646
id
@@ -136,7 +136,7 @@ function SpanAsideAnnotationList(props: {
136136
const data = useFragment<SpanAsideAnnotationList_span$key>(
137137
graphql`
138138
fragment SpanAsideAnnotationList_span on Span
139-
@argumentDefinitions(filterUserIds: { type: "[GlobalID!]" }) {
139+
@argumentDefinitions(filterUserIds: { type: "[GlobalID]" }) {
140140
project {
141141
id
142142
annotationConfigs {

app/src/pages/trace/SpanDetails.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export function SpanDetails({
192192
const { viewer } = useViewer();
193193
const { span } = useLazyLoadQuery<SpanDetailsQuery>(
194194
graphql`
195-
query SpanDetailsQuery($id: GlobalID!, $filterUserIds: [GlobalID!]) {
195+
query SpanDetailsQuery($id: GlobalID!, $filterUserIds: [GlobalID]) {
196196
span: node(id: $id) {
197197
__typename
198198
... on Span {
@@ -255,7 +255,7 @@ export function SpanDetails({
255255
`,
256256
{
257257
id: spanNodeId,
258-
filterUserIds: viewer?.id ? [viewer.id] : null,
258+
filterUserIds: viewer ? [viewer.id] : [null],
259259
}
260260
);
261261

app/src/pages/trace/__generated__/SpanAsideAnnotationList_span.graphql.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/pages/trace/__generated__/SpanAside_span.graphql.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/pages/trace/__generated__/SpanDetailsQuery.graphql.ts

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/phoenix/server/api/input_types/SpanAnnotationFilter.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class SpanAnnotationFilterCondition:
1515
names: Optional[list[str]] = UNSET
1616
sources: Optional[list[AnnotationSource]] = UNSET
17-
user_ids: Optional[list[GlobalID]] = UNSET
17+
user_ids: Optional[list[Optional[GlobalID]]] = UNSET
1818

1919
def __post_init__(self) -> None:
2020
if isinstance(self.names, list) and not self.names:
@@ -47,7 +47,8 @@ def satisfies_filter(span_annotation: models.SpanAnnotation, filter: SpanAnnotat
4747
return False
4848
if include.user_ids:
4949
user_rowids = [
50-
from_global_id_with_expected_type(user_id, "User") for user_id in include.user_ids
50+
from_global_id_with_expected_type(user_id, "User") if user_id is not None else None
51+
for user_id in include.user_ids
5152
]
5253
if span_annotation.user_id not in user_rowids:
5354
return False
@@ -58,7 +59,8 @@ def satisfies_filter(span_annotation: models.SpanAnnotation, filter: SpanAnnotat
5859
return False
5960
if exclude.user_ids:
6061
user_rowids = [
61-
from_global_id_with_expected_type(user_id, "User") for user_id in exclude.user_ids
62+
from_global_id_with_expected_type(user_id, "User") if user_id is not None else None
63+
for user_id in exclude.user_ids
6264
]
6365
if span_annotation.user_id in user_rowids:
6466
return False

0 commit comments

Comments
 (0)