Skip to content

feat: added batch fill for dataset size and files#1302

Merged
cka-y merged 12 commits into
mainfrom
feat/1260
Aug 6, 2025
Merged

feat: added batch fill for dataset size and files#1302
cka-y merged 12 commits into
mainfrom
feat/1260

Conversation

@cka-y

@cka-y cka-y commented Jul 24, 2025

Copy link
Copy Markdown
Contributor

Summary:
This pull request introduces a new task, rebuild_missing_dataset_files, to process GTFS datasets with missing file metadata.

Expected behavior:

  • New Task: rebuild_missing_dataset_files: Added the rebuild_missing_dataset_files functionality to process GTFS datasets, including downloading, extracting, uploading files to Google Cloud Storage (GCS), and updating metadata in the database.
  • Database Changes: Modified the GtfsFile table schema to add columns for hash and hosted_url.

Testing tips:
Follow the README documentation to test in DEV.

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)

@cka-y cka-y linked an issue Jul 24, 2025 that may be closed by this pull request
@cka-y cka-y requested a review from Copilot July 24, 2025 18:45

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 pull request adds functionality to rebuild missing dataset files for GTFS datasets by downloading, extracting, and uploading files to Google Cloud Storage while updating database metadata. The changes implement a new task that can fill in missing file information for datasets that lack zipped/unzipped sizes or extracted file records.

  • Adds a new task handler for rebuilding missing dataset files with batch processing capabilities
  • Updates database schema to include hash and hosted_url columns for GTFS files
  • Configures cloud function environment with datasets bucket name for file storage

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
liquibase/changes/feat_1260.sql Database migration to add hash and hosted_url columns to GtfsFile table
liquibase/changelog.xml Includes the new database migration in the changelog
infra/functions-python/main.tf Adds DATASETS_BUCKET_NAME environment variable to tasks executor function
functions-python/tasks_executor/src/tasks/dataset_files/rebuild_missing_dataset_files.py Main implementation of the rebuild missing dataset files functionality
functions-python/tasks_executor/src/tasks/dataset_files/README.md Documentation for the new task
functions-python/tasks_executor/src/main.py Registers the new task handler in the main tasks registry
functions-python/tasks_executor/requirements.txt Adds google-cloud-storage dependency
functions-python/tasks_executor/README.md Updates main README with formatting corrections

Comment thread functions-python/tasks_executor/README.md
@cka-y cka-y marked this pull request as ready for review August 4, 2025 12:39
@cka-y cka-y requested a review from davidgamez August 4, 2025 13:25

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@cka-y did you check the memory usage for a large dataset?

Comment thread functions-python/tasks_executor/src/tasks/dataset_files/README.md
@cka-y

cka-y commented Aug 5, 2025

Copy link
Copy Markdown
Contributor Author

@cka-y did you check the memory usage for a large dataset?

@davidgamez I tested multiple times in dev until timeout and didn't run into memory issues but I'm pretty sure there will be. I planned on going deeper in memory/performance improvements as part of #1297 which is my next task.

@cka-y cka-y requested a review from davidgamez August 6, 2025 19:08
"key": "FEEDS_DATABASE_URL"
},
{
"key": "FEEDS_CREDENTIALS",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💪

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great addition, this will open the path to get more analytics and future features! 🥇

@cka-y cka-y merged commit c480b2e into main Aug 6, 2025
3 checks passed
@cka-y cka-y deleted the feat/1260 branch August 6, 2025 19:17
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.

Unzip and store latest GTFS feeds(batchfill)

3 participants