Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ DESCRIPTION >
- `organizationDependencyPercentage` column is the combined contribution percentage of dependent organizations.
- `achievements` column is an array of tuples (leaderboardType, rank, totalCount) representing project achievements.
- `healthScore` column is the overall health score for the project (0-100).
- `contributorHealthScore` column is the health score percentage for the contributors category (0-100).
- `popularityHealthScore` column is the health score percentage for the popularity category (0-100).
- `developmentHealthScore` column is the health score percentage for the development category (0-100).
- `securityHealthScore` column is the health score percentage for the security category (0-100).
Comment on lines 18 to +22
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The description states these category scores are in the 0-100 range, but the schema marks them as Nullable(Float64) and the upstream join can yield NULL (or even NaN if not sanitized). Consider updating the column docs to mention when NULL is expected (e.g., missing health score data), or alternatively make the pipe coalesce/sanitize and change the schema to non-nullable for clearer API semantics.

Suggested change
- `healthScore` column is the overall health score for the project (0-100).
- `contributorHealthScore` column is the health score percentage for the contributors category (0-100).
- `popularityHealthScore` column is the health score percentage for the popularity category (0-100).
- `developmentHealthScore` column is the health score percentage for the development category (0-100).
- `securityHealthScore` column is the health score percentage for the security category (0-100).
- `healthScore` column is the overall health score for the project; when present, it is a value in the 0-100 range, and it is NULL when health score data is unavailable.
- `contributorHealthScore` column is the health score percentage for the contributors category; when present, it is a value in the 0-100 range, and it is NULL when the contributors health score is unavailable.
- `popularityHealthScore` column is the health score percentage for the popularity category; when present, it is a value in the 0-100 range, and it is NULL when the popularity health score is unavailable.
- `developmentHealthScore` column is the health score percentage for the development category; when present, it is a value in the 0-100 range, and it is NULL when the development health score is unavailable.
- `securityHealthScore` column is the health score percentage for the security category; when present, it is a value in the 0-100 range, and it is NULL when the security health score is unavailable.

Copilot uses AI. Check for mistakes.
- `firstCommit` column is the timestamp of the first commit in the project.
- `starsLast365Days` column is the count of stars in the last 365 days.
- `forksLast365Days` column is the count of forks in the last 365 days.
Expand Down Expand Up @@ -43,6 +47,10 @@ SCHEMA >
`organizationDependencyPercentage` Float64,
`achievements` Array(Tuple(String, UInt64, UInt64)),
`healthScore` Nullable(Float64),
`contributorHealthScore` Nullable(Float64),
`popularityHealthScore` Nullable(Float64),
`developmentHealthScore` Nullable(Float64),
`securityHealthScore` Nullable(Float64),
`firstCommit` Nullable(DateTime64(3)),
`starsLast365Days` UInt64,
`forksLast365Days` UInt64,
Expand Down
6 changes: 5 additions & 1 deletion services/libs/tinybird/pipes/project_insights.pipe
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DESCRIPTION >
- `project_insights.pipe` serves project insights data for a specific project.
- Returns comprehensive metrics including project metadata (name, logoUrl, isLF), health score, contributor count, software value, contributor and organization dependency metrics, leaderboard achievements, and activity metrics for both current and previous 365-day periods.
- Returns comprehensive metrics including project metadata (name, logoUrl, isLF), health score with category breakdowns (contributors, popularity, development, security), contributor count, software value, contributor and organization dependency metrics, leaderboard achievements, and activity metrics for both current and previous 365-day periods.
- Parameters:
- `slug`: Optional string for a single project slug (e.g., 'kubernetes')
- `slugs`: Optional array of project slugs for multi-project query (e.g., ['kubernetes', 'tensorflow'])
Expand All @@ -27,6 +27,10 @@ SQL >
organizationDependencyPercentage,
achievements,
healthScore,
contributorHealthScore,
popularityHealthScore,
developmentHealthScore,
securityHealthScore,
firstCommit,
starsLast365Days,
forksLast365Days,
Expand Down
10 changes: 9 additions & 1 deletion services/libs/tinybird/pipes/project_insights_copy.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ SQL >
contributorDependencyCount,
contributorDependencyPercentage,
organizationDependencyCount,
organizationDependencyPercentage
organizationDependencyPercentage,
contributorPercentage,
popularityPercentage,
developmentPercentage,
securityPercentage
FROM health_score_copy_ds

NODE project_insights_copy_achievements
Expand Down Expand Up @@ -106,6 +110,10 @@ SQL >
COALESCE(dep.organizationDependencyPercentage, 0) AS organizationDependencyPercentage,
COALESCE(ach.achievements, []) AS achievements,
base.healthScore AS healthScore,
dep.contributorPercentage AS contributorHealthScore,
dep.popularityPercentage AS popularityHealthScore,
dep.developmentPercentage AS developmentHealthScore,
dep.securityPercentage AS securityHealthScore,
Comment on lines +113 to +116
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The new category score fields are pulled directly from health_score_copy_ds without normalizing invalid float values. Elsewhere (e.g. pipes/health_score_sink.pipe) these score/percentage columns are guarded with if(isNaN(...), null, ...), which suggests NaNs can occur. Consider applying the same NaN-to-null (and optionally COALESCE) handling here so project_insights_copy_ds doesn’t materialize NaNs into the API-facing dataset.

Suggested change
dep.contributorPercentage AS contributorHealthScore,
dep.popularityPercentage AS popularityHealthScore,
dep.developmentPercentage AS developmentHealthScore,
dep.securityPercentage AS securityHealthScore,
if(isNaN(dep.contributorPercentage), null, dep.contributorPercentage) AS contributorHealthScore,
if(isNaN(dep.popularityPercentage), null, dep.popularityPercentage) AS popularityHealthScore,
if(isNaN(dep.developmentPercentage), null, dep.developmentPercentage) AS developmentHealthScore,
if(isNaN(dep.securityPercentage), null, dep.securityPercentage) AS securityHealthScore,

Copilot uses AI. Check for mistakes.
base.firstCommit AS firstCommit,
l365.starsLast365Days AS starsLast365Days,
l365.forksLast365Days AS forksLast365Days,
Expand Down
Loading