Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] item appears twice in paginated results when sorting on float column #3114

Open
axiomofjoy opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@axiomofjoy
Copy link
Contributor

Spans can appear more than once when paginating, probably due to a floating point rounding issue.

To reproduce:

  • Check out out ae0ac67 on the pagination branch.
  • Sort by latency in ascending order and scroll to the second page. One item should appear twice as the last item of the first page and the first item of the second page.
  • Alternatively, make the following GraphQL request:
query TracesTableQuery(
  $after: String = null
  $filterCondition: String = null
  $first: Int = 100
  $sort: SpanSort = {col: startTime, dir: desc}
  $timeRange: TimeRange
  $id: GlobalID!
) {
  node(id: $id) {
    __typename
    ...TracesTable_spans_1XEuU
    __isNode: __typename
    id
  }
}

fragment SpanColumnSelector_evaluations on Project {
  spanEvaluationNames
}

fragment TracesTable_spans_1XEuU on Project {
  ...SpanColumnSelector_evaluations
  rootSpans: spans(first: $first, after: $after, sort: $sort, rootSpansOnly: true, filterCondition: $filterCondition, timeRange: $timeRange) {
    edges {
      rootSpan: node {
        spanKind
        name
        metadata
        statusCode: propagatedStatusCode
        startTime
        latencyMs
        cumulativeTokenCountTotal
        cumulativeTokenCountPrompt
        cumulativeTokenCountCompletion
        parentId
        input {
          value
        }
        output {
          value
        }
        context {
          spanId
          traceId
        }
        spanEvaluations {
          name
          label
          score
        }
        documentRetrievalMetrics {
          evaluationName
          ndcg
          precision
          hit
        }
        descendants {
          spanKind
          name
          statusCode: propagatedStatusCode
          startTime
          latencyMs
          parentId
          cumulativeTokenCountTotal: tokenCountTotal
          cumulativeTokenCountPrompt: tokenCountPrompt
          cumulativeTokenCountCompletion: tokenCountCompletion
          input {
            value
          }
          output {
            value
          }
          context {
            spanId
            traceId
          }
          spanEvaluations {
            name
            label
            score
          }
          documentRetrievalMetrics {
            evaluationName
            ndcg
            precision
            hit
          }
        }
      }
      cursor
      node {
        __typename
      }
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
  id
}

with variables

{
  "after": "NjcxOkZMT0FUOjIxNTUuMzA4OTk5OTk5OTk5Nw==",
  "filterCondition": "",
  "first": 100,
  "sort": {
    "col": "latencyMs",
    "dir": "asc",
    "evalResultKey": null
  },
  "timeRange": {
    "start": "1971-01-01T08:00:00.000Z",
    "end": "2025-05-08T00:00:00.000Z"
  },
  "id": "UHJvamVjdDox"
}

The rowid of the cursor and the rowid of the first record in the response is 671.

@axiomofjoy axiomofjoy added bug Something isn't working triage issues that need triage labels May 8, 2024
@mikeldking mikeldking removed the triage issues that need triage label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📘 Todo
Development

No branches or pull requests

2 participants