Conversation
There was a problem hiding this comment.
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 |
davidgamez
left a comment
There was a problem hiding this comment.
@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. |
| "key": "FEEDS_DATABASE_URL" | ||
| }, | ||
| { | ||
| "key": "FEEDS_CREDENTIALS", |
davidgamez
left a comment
There was a problem hiding this comment.
Great addition, this will open the path to get more analytics and future features! 🥇
Summary:
This pull request introduces a new task,
rebuild_missing_dataset_files, to process GTFS datasets with missing file metadata.Expected behavior:
rebuild_missing_dataset_files: Added therebuild_missing_dataset_filesfunctionality to process GTFS datasets, including downloading, extracting, uploading files to Google Cloud Storage (GCS), and updating metadata in the database.GtfsFiletable schema to add columns forhashandhosted_url.Testing tips:
Follow the README documentation to test in DEV.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything