Repository navigation
fix: inf retry budget timeout cap, AdaptiveClient(read_timeout=None), and dynamic flush pin order - #134
Merged
Conversation
…timeout=None), and dynamic flush pin order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three small correctness edge-case fixes:
saturate/http.py,saturate/transport.py):pump(..., read_timeout=None, retry_budget_s=math.inf)is explicitly allowed byPUMP_SETTINGS, but on retry 1Timeouts.capped(math.inf)turnedNone/0phases intoinfandaiohttp'sceil_timeout(inf)raisedOverflowError: cannot convert float infinity to integer— bypassingcall_endpoint()'s retry handler (failing the row asclient: OverflowErrorinpump(), or raising directly fromAdaptiveClient.post()).Timeouts.capped()now returnsselfformath.isinf(cap), and_send()skips capping/wait_forwhenmath.isinf(left).AdaptiveClient(read_timeout=None)(saturate/core.py): now raisesValueError("AdaptiveClient requires retry_budget_s when read_timeout is None")(matchingpump()) instead of a bareTypeErroron2 * None, and typesread_timeout: float | None = 1800.0. (read_timeout=0keeps its existing tested behaviour.)saturate/sink.py):ParquetSink.flush()now computes the next dynamic schema without mutatingself._schema/self._pinneduntil after_write_hf_flush()/_write()succeeds, so a failed flush cannot leave unlanded columns pinned on the sink.Testing
tests/test_pump_settings.py:Timeouts.capped(math.inf)preserves unlimited phases (for_aiohttp().total is None).test_infinite_retry_budget_with_no_read_timeout_retries_cleanly: end-to-endpump(read_timeout=None, retry_budget_s=math.inf)with a 503 on attempt 1 retries cleanly and lands all rows.test_adaptive_client_requires_retry_budget_when_read_timeout_is_none:ValueErrorwithoutretry_budget_s, succeeds with one.test_failed_dynamic_flush_does_not_pin_unlanded_schemaintests/test_sinks.py.772 passed, 30 skipped),ruff check,ruff format --check, andty check saturate testsall green.