-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make it possible to insert several items at once #363
Make it possible to insert several items at once #363
Conversation
Coverage Report for ./frontend
File CoverageNo changed files found. |
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.
Really happy to see singledispatchmethod
in one of your PR <3.
Good idea !
a6b23c5
to
aa2263c
Compare
aa2263c
to
49bc9e1
Compare
These are checks that were activated when we set 'requires-python = ">= 3.11"' in pyproject.toml
Update to take into account design decisions in #173 |
- Raise a `ProjectPutError` - When `on_error` is "raise", raise on the first error (rather than collecting all errors at the end).
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.
Nice work 👍🏻
In the end, we decided with @thomass-dev to simplify the behaviour:
|
A succession of project.put("0", 0, on=error="warn")
project.put("1", 1, on=error="warn")
project.put(2, 2, on=error="warn") # bad
project.put("3", 3, on=error="warn")
# ==
project.put({"0": 0, "1": 1, 2: 2, "3": 3}, on=error="warn")
# OUTPUT
# ("0", 0), ("1", 1), ("3", 3) inserted
# warning on (2, 2) project.put("0", 0, on=error="raise")
project.put("1", 1, on=error="raise")
project.put(2, 2, on=error="raise") # bad
project.put("3", 3, on=error="raise")
# ==
project.put({"0": 0, "1": 1, 2: 2, "3": 3}, on=error="raise")
# OUTPUT
# ("0", 0) and ("1", 1) inserted
# exception on (2, 2) |
put_several
which is aliased toput
Item
sput
a special case ofput_several
TypeError
whenProject.put
receives a non-string key (closes Project keys must be strings #362)