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

209 run in batches #228

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

209 run in batches #228

wants to merge 8 commits into from

Conversation

zenon18
Copy link
Contributor

@zenon18 zenon18 commented May 21, 2024

Pull request for #209

Created a generator function that takes a file pointer and a batch size and reads up to that many queries from the file and calls run.

@jhoshiko jhoshiko self-requested a review May 21, 2024 14:19
@@ -135,6 +135,55 @@ def run(
return results[0]
return results

def run_in_batches(
self, fp: TextIO, batch_size: int
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of passing a file pointer, let's instead pass a Path or string and then create the file pointer in this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gotcha will update

@jhoshiko
Copy link
Collaborator

jhoshiko commented May 21, 2024

After discussing this feature with the group, it sounds like we should look into adding a parser for query files to prevent crashes from faulty files (See issue #236)

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