fix: persist preview and preview_rows fields after datastore push#270
Open
fix: persist preview and preview_rows fields after datastore push#270
Conversation
…preview fields The preview and preview_rows fields were being set on the resource via resource_update, but then immediately overwritten when datastore_create (called via send_resource_to_datastore with calculate_record_count=True) internally modified the resource metadata. Fix: Move _update_resource_metadata() call to AFTER send_resource_to_datastore() and re-fetch the resource to get the latest state. This ensures our preview fields are set last and persist correctly. Applied to both the new pipeline (metadata.py) and legacy code (jobs_legacy.py). Co-authored-by: minhajuddin2510 <68331751+minhajuddin2510@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing preview fields in dataset after push
fix: persist preview and preview_rows fields after datastore push
Mar 10, 2026
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.
previewandpreview_rowsresource fields were being set viaresource_updatebeforedatastore_create(withcalculate_record_count=True), which internally modifies the resource and overwrites our fields.Changes
MetadataStage.process()andjobs_legacy.py: callsend_resource_to_datastore()first, then_update_resource_metadata()/update_resource()dsu.get_resource()before setting our fields, so we operate on the latest state post-datastore_create