Require gfw-common>=0.16.1 for the create_view column-order fix - #144
Merged
Merged
Conversation
gfw-common 0.16.0's BigQueryHelper.create_view() could silently swap column values when its schema argument's field order didn't match the view query's actual output order (see GlobalFishingWatch/gfw-common#93). This affected pipe-gaps' raw_gaps view, where start_seg_id and start_msgid ended up swapped.
tomaslink
force-pushed
the
hotfix-gfw-common-create-view-fix
branch
from
October 2, 2026 04:44
c7b48f6 to
f5bf861
Compare
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.
Summary
BigQueryHelper.create_view()could silently swap column values when itsschemaargument's field order didn't match the view query's actual output order.raw_gapsview directly:start_seg_idandstart_msgidended up swapped, because the view'sSELECTlist followedGap's NamedTuple declaration order (queries/gaps.py) whileschemafollowedgaps.json's order, and those two orders disagreed for this one pair.gfw-common[bq,beam]from~=0.16.0to~=0.16.1and pipe-gaps to0.14.1.Blocked on release: gfw-common#93 is open but not yet merged/released. This PR is ready to go but can't actually install/pass CI until gfw-common 0.16.1 is published to PyPI.
Test plan
gfw-int-ais-datalake.gaps_v1.raw_gapsview should be recreated (next scheduled pipeline run, or manually) to pick up the fix.