fix: feed files are not been extracted#1303
Merged
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rifier.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where extracted feed files were not being copied to the GCP bucket. The fix ensures that the extracted file path is created consistently in one location and passed to functions that need it, rather than being calculated in multiple places with slight differences.
- Refactored
download_contentto return the extracted files path as a third value - Modified
upload_file_to_storageto accept the extracted files path as a parameter instead of recalculating it - Updated test mocks to handle the new return signature
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
functions-python/batch_process_dataset/src/main.py |
Updated method signatures to pass extracted files path consistently and fixed extraction logic |
functions-python/batch_process_dataset/tests/test_batch_process_dataset_main.py |
Updated test mocks to handle the new return signature with extracted files path |
functions-python/batch_process_dataset/src/scripts/download_verifier.py |
Added verification script for testing download functionality locally |
functions-python/batch_process_dataset/.coveragerc |
Excluded scripts directory from coverage reporting |
davidgamez
commented
Jul 25, 2025
Member
Author
cka-y
approved these changes
Jul 29, 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.

Summary:
Closes: #1298
The extracted file's path was built in two different places with a minor logic difference. In this PR, the folder path is created only once and passed along to the functions where needed. The extraction of the files was moved to further ahead in the flow making sure it only happens when a dataset update is needed.
As a minor addition, I added a "verifier" function to be able to run locally the download, unzipping and bucker upload using a local GCP storage emulator.
Expected behavior:
The extracted feeds files are copy over the GCP bucket.
Testing tips:
You can test locally using the
download_verifier.pyfile.download_verifier.pyand change the PRODUCER_URL to an actual URL from a feeddownload_verifier.pyvia terminal or IDE.cloudstoragefolder and verify that it contains a proper file structure like the following imagePlease make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything