Skip to content

Recognise all *.stat.gl hosts as Statistics Greenland's API - #44

Merged
emilmalta merged 2 commits into
StatisticsGreenland:masterfrom
emilmalta:master
Sep 16, 2026
Merged

emilmalta merged 2 commits into
StatisticsGreenland:masterfrom
emilmalta:master

Conversation

@emilmalta

Copy link
Copy Markdown
Collaborator

is_greenland_api() only matched bank.stat.gl, so statwww's test statbank was treated as a generic PXWeb API: no X-canonicalisation of the table ID's 3rd char, no language inference from it. D/N/E-suffixed table IDs (e.g. BEDSTA) failed with "Table ... not found" against testbank; X-suffixed IDs worked either way, masking it.

Now matches any *.stat.gl host (with optional port). statgl_search()'s inline copy of the old check now calls is_greenland_api() instead of duplicating the regex. No behaviour change for bank.stat.gl or non-Greenland APIs. Adds is_greenland_api() test cases; bumps to 0.5.2.9006.

emilmalta and others added 2 commits September 16, 2026 13:15
…tat.gl

statwww's publish script points statgl.api_url at testbank.stat.gl. The
old check only matched bank.stat.gl, so is_greenland_api() returned
FALSE for testbank: statgl_url() skipped canonicalising the table ID's
3rd character to X (BEDSTA stayed BEDSTA instead of becoming BEXSTA)
and skipped inferring the language from it, and statgl_search() skipped
the subfolder-path lookup. D/N/E-suffixed table IDs then failed with
"Table ... not found" against testbank; X-suffixed IDs happened to work
either way, which is why this went unnoticed.

is_greenland_api() now matches any *.stat.gl host (with optional port),
and statgl_search()'s inline copy of the old check is replaced with a
call to it so there's one definition. bank.stat.gl and non-Greenland
PXWeb APIs are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019EvEGd5rGQFKFKDzB7uae8
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019EvEGd5rGQFKFKDzB7uae8
@emilmalta
emilmalta merged commit 65232f3 into StatisticsGreenland:master Sep 16, 2026
5 checks passed
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.

1 participant