Repository navigation
Conversation
`jsonable_encoder` maps `Path` to `str`, so the separator is the platform's; the test asserted a POSIX literal and was red on Windows for a reason unrelated to the encoder. Comparing against `str(Path(...))` states what the mapping does without pinning it to one system.
This branch has not been deployed
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.
Important
!Related Issue
Closes #431
Summary
jsonable_encodermapsPathtostr(src/graphon/model_runtime/utils/encoders.py:86), so the separator in the answer is the platform's. The test asserted a POSIX literal, so it failed on Windows for a reason that has nothing to do with the encoder:The test now compares against
str(Path("/example/test")), which states the mapping without pinning it to one system, and keeps thePurePathcase alongside it.Deliberately test-side only: making the encoder emit
as_posix()for everyPathwould change what a Windows user's paths look like in the JSON the API returns. That is a product decision - I am happy to make it a separate change if stable output across platforms is what you want; it was not something I wanted to slip into a test fix.Verification
pytest tests/model_runtime/test_encoders.py-> 17 passed; onmainthe path case fails with the assertion above.ruff check,ruff format --checkclean, andty checkreports only the two diagnostics thatmainalready has intests/variables/test_factory.py.test_repository_docsfailures that test: format repository-docs messages with forward slashes #430 fixes; they are unrelated to this file and are red onmainhere.Checklist
!