Recognise all *.stat.gl hosts as Statistics Greenland's API - #44
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
is_greenland_api()only matchedbank.stat.gl, sostatwww'stest 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.glhost (with optional port).statgl_search()'s inline copy of the old check now callsis_greenland_api()instead of duplicating the regex. No behaviour change for bank.stat.gl or non-Greenland APIs. Addsis_greenland_api()test cases; bumps to 0.5.2.9006.