Skip to content

fix: feed files are not been extracted#1303

Merged
davidgamez merged 8 commits into
mainfrom
fix/feed_unzip_copy
Jul 29, 2025
Merged

fix: feed files are not been extracted#1303
davidgamez merged 8 commits into
mainfrom
fix/feed_unzip_copy

Conversation

@davidgamez

@davidgamez davidgamez commented Jul 24, 2025

Copy link
Copy Markdown
Member

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.py file.

  • Update your pip dependencies locally
  • Open download_verifier.py and change the PRODUCER_URL to an actual URL from a feed
  • Execute download_verifier.py via terminal or IDE
  • Review the newly created .cloudstoragefolder and verify that it contains a proper file structure like the following image
Screenshot 2025-07-25 at 1 13 13 PM

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@davidgamez davidgamez requested a review from Copilot July 24, 2025 20:36

This comment was marked as outdated.

davidgamez and others added 2 commits July 24, 2025 16:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rifier.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@davidgamez davidgamez requested a review from Copilot July 24, 2025 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_content to return the extracted files path as a third value
  • Modified upload_file_to_storage to 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

Comment thread functions-python/batch_process_dataset/src/main.py
Comment thread functions-python/helpers/logger.py
@davidgamez davidgamez marked this pull request as ready for review July 25, 2025 17:08
@davidgamez

Copy link
Copy Markdown
Member Author

Extracted feed in DEV environment:
Screenshot 2025-07-25 at 1 15 32 PM

@davidgamez davidgamez requested a review from cka-y July 25, 2025 17:17
@davidgamez davidgamez merged commit 0e6d2f3 into main Jul 29, 2025
4 of 5 checks passed
@davidgamez davidgamez deleted the fix/feed_unzip_copy branch July 29, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feed files are not been extracted

3 participants