Fix NULL handling in export workflow to prevent Antarctica subregion_id conversion from NULL to 0#1067
Merged
Fix NULL handling in export workflow to prevent Antarctica subregion_id conversion from NULL to 0#1067
Conversation
Co-authored-by: dr5hn <6929121+dr5hn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Antarctica does not belong to any specific region or subregion in the traditional sense used for countries.
Fix Antarctica subregion_id from 0 to null in data formats
Aug 6, 2025
Owner
|
@copilot The process is we update |
Co-authored-by: dr5hn <6929121+dr5hn@users.noreply.github.com>
Contributor
Author
You're absolutely right! I found the issue in the workflow converter. The problem was in I've fixed it by properly handling NULL values: The fix is in commit a836bcb. Now when the workflow runs, it should properly export Antarctica's subregion_id as null instead of 0 in all formats. |
Copilot
AI
changed the title
Fix Antarctica subregion_id from 0 to null in data formats
Fix NULL handling in export workflow to prevent Antarctica subregion_id conversion from NULL to 0
Aug 6, 2025
dr5hn
approved these changes
Aug 6, 2025
dr5hn
approved these changes
Aug 6, 2025
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.
Antarctica does not belong to any specific subregion and should have a
subregion_idofNULL. However, the export workflow was incorrectly convertingNULLvalues to0during the JSON export process, which then propagated to all other data formats (CSV, SQL Server, etc.).Root Cause
The issue was in
/bin/Commands/ExportJson.phpwhere PHP was casting NULL database values to integers:Solution
Fixed the NULL handling by checking for NULL values before casting:
This ensures that when the workflow regenerates the data formats, Antarctica's
subregion_idwill be properly exported as:NULLin SQL filesnullin JSON filesNULLin SQL Server filesThe fix also applies to
region_idto prevent similar issues with any countries that might have NULL region values.Fixes #971.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.