Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions services/libs/tinybird/pipes/project_insights.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ DESCRIPTION >
- `slugs`: Optional array of project slugs for multi-project query (e.g., ['kubernetes', 'tensorflow'])
- `ids`: Optional array of project ids for multi-project query
- At least one of `slug`, `slugs`, or `ids` should be provided.
- `isLfx`: Optional integer (1 = LFX, 0 = non-LFX) to filter by LFX project status
- `orderByField`: Optional string specifying sort field, defaults to 'name'
- `orderByDirection`: Optional string ('asc' or 'desc'), defaults to 'asc'
- `pageSize`: Optional integer for result limit, defaults to 10
- `page`: Optional integer for pagination offset calculation, defaults to 0
Comment on lines +9 to +13
- Response: Project records with all insights metrics including achievements as array of (leaderboardType, rank, totalCount) tuples
TAGS ""Insights, Widget", "Project""

Expand Down Expand Up @@ -54,3 +59,29 @@ SQL >
AND id
IN {{ Array(ids, 'String', description="Filter by project id list", required=False) }}
{% end %}
{% if defined(isLfx) %}
AND isLF
= {{
UInt8(
isLfx, description="Filter by LFX project (1 = LFX, 0 = non-LFX)", required=False
)
}}
{% end %}
ORDER BY
{{ column(String(orderByField, "name", description="Order by field.", required=False)) }}
{% if String(
Comment on lines +70 to +72
orderByDirection,
'asc',
description="Order by direction. ASC or DESC",
required=False,
) == 'asc' or String(
orderByDirection,
'asc',
description="Order by direction. ASC or DESC",
required=False,
) == 'ASC' %} ASC
{% else %} DESC
{% end %},
name ASC
LIMIT {{ Int32(pageSize, 10) }}
OFFSET {{ Int32(page, 0) * Int32(pageSize, 10) }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default LIMIT silently truncates previously unlimited query results

High Severity

Adding LIMIT 10 (default) and OFFSET 0 to a query that previously returned all matching rows is a silent breaking change. Any existing caller passing more than 10 values in slugs or ids will now receive only the first 10 results without any indication of truncation. Since this is a Tinybird API endpoint (_endpoint node), external consumers won't be aware they need to start paginating to get complete results.

Fix in Cursor Fix in Web

Loading