Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate new sources.csv from database #888

Merged
merged 23 commits into from
Jan 28, 2025

Conversation

jcpitre
Copy link
Contributor

@jcpitre jcpitre commented Jan 21, 2025

Summary:

closes #779

Also moved some libraries into the shared folder, so a bunch of changes are just modification to the import.

Expected behavior:

After running the cloud function, the file https://storage.googleapis.com/mobilitydata-datasets-dev/sources_v2.csv should contain the contents of the DB

Testing tips:
Painstakingly look at the result csv and see if it makes sense.

Deployment can be tested by running the api-dev.yml and then triggering the function.

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)

@emmambd emmambd linked an issue Jan 27, 2025 that may be closed by this pull request
@@ -318,18 +318,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN_OUTPUT: ${{ steps.plan.outputs.stdout }}

- name: Persist TF plan
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines 16 to 17
"max_instance_request_concurrency": 20,
"max_instance_count": 10,
Copy link
Member

Choose a reason for hiding this comment

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

Let's use set the number of instances to one:

Suggested change
"max_instance_request_concurrency": 20,
"max_instance_count": 10,
"max_instance_request_concurrency": 1,
"max_instance_count": 1,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

:return: A filled DataCollector
"""
db = Database(database_url=os.getenv("FEEDS_DATABASE_URL"))
print(f"Using database {db.database_url}")
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jcpitre jcpitre changed the title 779 generate new sourcescsv from postgresql database2 feat: generate new sources.csv database Jan 28, 2025
Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM!

@jcpitre jcpitre merged commit 5c62297 into main Jan 28, 2025
3 checks passed
@jcpitre jcpitre deleted the 779-generate-new-sourcescsv-from-postgresql-database2 branch January 28, 2025 20:57
@jcpitre jcpitre changed the title feat: generate new sources.csv database feat: generate new sources.csv from database Jan 28, 2025
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.

Generate new sources.csv from PostgreSQL database
2 participants