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

_save_batch() should not be a generator #214

Merged
merged 2 commits into from
Oct 1, 2024
Merged

_save_batch() should not be a generator #214

merged 2 commits into from
Oct 1, 2024

Conversation

hancush
Copy link
Member

@hancush hancush commented Sep 30, 2024

Overview

Change ref in workflow back to deploy before merging and deploying.

I introduced a bug by making _save_batch() a generator. Generators are great in that they are lazy, but that's only great if you actually iterate them. 🫠 There's no reason for the save method to be a generator, so I made it a regular function instead. I also turned up the logging so we have a better idea of the record churn for future debugging endeavors.

Addresses Marjorie's email.

Testing Instructions

Running on: https:/datamade/openness-project-nmid/actions/runs/11108320332

@hancush hancush temporarily deployed to openness-pro-hcg-delete-wzwtri September 30, 2024 14:33 Inactive
@@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: "deploy"
ref: "hcg/delete-fix-2"
Copy link
Member Author

Choose a reason for hiding this comment

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

Revert before merge.

@hancush hancush requested a review from fgregg September 30, 2024 14:35
Comment on lines +247 to +249
if len(batch) > 0:
self._save_batch(batch)
n_imported += len(batch)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was also missing!!! 🙀

@fgregg fgregg marked this pull request as ready for review September 30, 2024 15:20
@fgregg fgregg merged commit 7767046 into main Oct 1, 2024
19 checks passed
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.

2 participants