Repository navigation
Conversation
main.py at the repo root is the "Hello from roe-python!" placeholder left by project init. It is not part of the package (the build ships src/roe only), and nothing imports or runs it. Tested: uv run pytest, ruff check, ruff format --check pass.
`if TYPE_CHECKING: pass` guards nothing. Remove it and the now unused TYPE_CHECKING import. Tested: uv run pytest, ruff check, ruff format --check pass.
_iter_chunks slices items[i:i + chunk_size] only for i < len(items), so every chunk it yields is non-empty and the three `if not chunk: continue` guards can never fire. Tested: uv run pytest, ruff check, ruff format --check pass.
AgentJobsAPI and AgentsAPI each defined an identical _iter_chunks static method and _MAX_BATCH_SIZE = 1000 class attribute. Keep a single private module-level copy of each and call it from both classes. Tested: uv run pytest, ruff check, ruff format --check pass.
_UNSET_SENTINEL() in models/job.py only lazily imported and returned roe._generated.types.UNSET. The module already imports from roe._generated at the top, so import UNSET there and drop the wrapper. Tested: uv run pytest, ruff check, ruff format --check pass; manual check that JobBatch.retrieve_status still sets error_message to Unset for both fresh and cached statuses.
|
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.
No public API or behaviour changes:
main.py"Hello from roe-python!" placeholder (not part of the package).if TYPE_CHECKING: passblock inapi/policies.py.if not chunk: continueguards inapi/agents.pythat can't fire (_iter_chunksnever yields an empty slice)._iter_chunks/_MAX_BATCH_SIZEinapi/agents.pyinstead of identical copies inAgentJobsAPIandAgentsAPI.UNSETdirectly inmodels/job.pyinstead of the private_UNSET_SENTINEL()wrapper.Testing
uv run pytest,ruff check,ruff format --check. Merges cleanly with #89 and #90.Note: a Roe API key is required to test these changes end to end; the unit tests here run without one.