Yes, you can specify a limit when pulling spans into a dataframe using `SpanQuery` by passing the `limit` parameter to the `query_spans` method. For example: `px.Client().query_spans(query, limit=100)` will return at most 100 spans. This is directly supported and works similarly to the SQL `LIMIT` clause, restricting the number of rows in the result dataframe. The default limit is often set to 1000 if not specified explicitly[^1^][^2^].
Would you like more detail or a code example?
Sources:
- <https://github.com/Arize-ai/phoenix/blob/main/docs/tracing/how-to-interact-with-traces/extract-data-from-spans.md|docs/tracing/how-to-interact-with-traces/extract-data-from-spans.md>
- <https://github.com/Arize-ai/phoenix/blob/main/src/phoenix/session/client.py|src/phoenix/session/client.py>