Skip to content

Set a default of 0 when a rating value is null when calculating rank#1675

Open
HutchyBen wants to merge 3 commits into
zkldi:mainfrom
HutchyBen:ranking-null
Open

Set a default of 0 when a rating value is null when calculating rank#1675
HutchyBen wants to merge 3 commits into
zkldi:mainfrom
HutchyBen:ranking-null

Conversation

@HutchyBen

Copy link
Copy Markdown
Contributor

ficxs #1674

@zkldi zkldi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

not correct! bpi can be negative. null should sort lower than all numbers, not just 0. Don't solve this with ?? -Infinity either. There is a proper way to do this with sql.

@HutchyBen HutchyBen requested a review from zkldi June 16, 2026 19:13
@HutchyBen

Copy link
Copy Markdown
Contributor Author

unapprove!! unapprove ill see what that fail was

@HutchyBen

Copy link
Copy Markdown
Contributor Author

the test is literally LOL?
it("returns ranking 1 when user rating is null (no one can be strictly greater than null)", async () => {

@HutchyBen

Copy link
Copy Markdown
Contributor Author

ill change the test add like another player and say null user should be last

@HutchyBen HutchyBen requested a review from zkldi June 16, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

profile rankings say you're #1 if you have a "null" rating on the metric

2 participants