-
Notifications
You must be signed in to change notification settings - Fork 307
Preserve order for collections.OrderedDict
#1801
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5980e5b
fix working
CloseChoice f5c2042
WIP: add test
CloseChoice 4f88e03
simplify test case
CloseChoice 21d83a3
speed up checks
CloseChoice 6e35fe9
optimize code
CloseChoice ae17586
Merge branch 'main' of github.com:pydantic/pydantic-core into fix-122…
CloseChoice 1b30fbc
update test dict
CloseChoice be8ef2b
remove auto formatting
CloseChoice bef11c6
update test_dict to reintroduce function I accidentally deleted
CloseChoice d52d85b
fix strict and updates as request in PR
CloseChoice 0e40c5c
update input python
CloseChoice c0e6b68
update test_dict using ruff
CloseChoice a8ffe29
fix linting error on rust
CloseChoice 907ed67
Merge branch 'main' into fix-12273-dict
CloseChoice 9784aa5
Merge branch 'main' of github.com:pydantic/pydantic-core into fix-122…
CloseChoice e8a8b2a
Merge branch 'fix-12273-dict' of github.com:CloseChoice/pydantic-core…
CloseChoice 7767ad5
try fix performance degradation
CloseChoice 90b27a1
fix performance issue
CloseChoice 6cef2dc
Merge branch 'main' into fix-12273-dict
CloseChoice 84faba3
simplify as discussed in PR
CloseChoice 376a38d
add test
CloseChoice fd28d80
simplify defaultdict test
CloseChoice 987e3b5
remove tests that were passing before
CloseChoice 939940d
update tests
CloseChoice 7f8e658
update description for graalpy test skipping
CloseChoice 40050eb
Merge branch 'main' into fix-12273-dict
CloseChoice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that we skip here due to the bug reported here: #1801 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interesting, does GraalPy show the bug in a pure Python repro? Otherwise this might imply a PyO3 bug on GraalPy (or a GraalPy C API issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
havent managed to recreate this in pure python. So true, this might be a bug in pyo3, but as I understand it, pyo3 is calling the c api mapping code and this is where it goes wrong, therefore I assumed this is ok graalpy's c api, the mapping protocol is not directly exposed in python, so it makes sense that this cannot be reproduced there.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I managed to verify that this is a graalpy bug. Here is the code for the C extension:
dict_printer.c
:setup.py
Then run
python setup.py build_ext --inplace
and executeThis outputs with graalpy:
using CPython:
So, no worries, no extra work on pyo3 @davidhewitt. I'll check graalpy issues and file one if necessary and link the it in the test-skip string.
EDIT: Here is the graalpy issue I just opened: oracle/graalpython#553
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super, thank you for going to such detail to verify this!