Skip to content

Conversation

richardsun0713
Copy link
Contributor

There is a limit of 100k data rows that can be checked at once for processing status. Split this call to the backend into chunks of 100k

@richardsun0713 richardsun0713 requested review from a team, apollonin and kkim-labelbox August 22, 2023 21:38
wait_processing_max_seconds: int = _wait_processing_max_seconds,
sleep_interval=30):
""" Wait until all the specified data rows are processed"""
start_time = datetime.now()
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the start_time is set to the beginning of this function, I think _poll_data_row_processing_status may not wait the full wait_processing_max_seconds per chunk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding was that the wait_processing_max_seconds was to be applied to the entire call for _wait_until_data_rows_are_processed, and not the individual chunks. This should preserve original behavior

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah gotcha makes sense


max_data_rows_per_poll = 100_000
if data_row_ids is not None:
for i in range(0, len(data_row_ids), max_data_rows_per_poll):
Copy link
Contributor

Choose a reason for hiding this comment

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

nice use of step for chunking

"Maximum wait time exceeded while waiting for data rows to be processed. Try creating a batch a bit later"
)
"Maximum wait time exceeded while waiting for data rows to be processed. "
"Try creating a batch a bit later")
Copy link
Contributor

Choose a reason for hiding this comment

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

is it supposed to be a multi-line string? does not work? I though smth like

Suggested change
"Try creating a batch a bit later")
raise ProcessingWaitTimeout("""Maximum wait time exceeded while waiting for data rows to be processed.
Try creating a batch a bit later""")

based on https://stackoverflow.com/questions/51449888/valueerror-compatibility-and-multi-line-string-aesthetics

@richardsun0713 richardsun0713 merged commit becff66 into develop Aug 23, 2023
@richardsun0713 richardsun0713 deleted the rsun/QQC-2355-2 branch August 23, 2023 17:46
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.

3 participants