Skip to content

fix(editor): weight Search Console position over rows with a position - #308

Merged
primoco merged 1 commit into
eullm:mainfrom
Gabriele06-local:fix/search-position-nulls
Nov 20, 2026
Merged

primoco merged 1 commit into
eullm:mainfrom
Gabriele06-local:fix/search-position-nulls

Conversation

@Gabriele06-local

Copy link
Copy Markdown
Contributor

totals() and top() weighted the position by impressions but divided by the sum of all impressions. Search Console stores NULL positions for rows with no reported position, so a page with (position 5, 100 impressions) plus (NULL, 100 impressions) was reported at position 2.5. The denominator now counts impressions only for rows that have a position, in both the totals and the per-key top list. Added a test with mixed NULL/non-NULL rows.

Verification: uv run pytest tests/test_weekly_search.py -q — 6 passed, 6 skipped (PostgreSQL only).

I have read and agree to the Contributor Licence Agreement in CLA.md.

@primoco
primoco merged commit 554ba7c into eullm:main Nov 20, 2026
4 checks passed
@primoco

primoco commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Merged, thanks!

@primoco primoco mentioned this pull request Nov 20, 2026
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.

2 participants