- Notifications
You must be signed in to change notification settings - Fork98
Adds default reads/writes to burr actions#269
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Add some tests
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
ce6ca20 to7a3e145Compareba5b4bd to72f8262CompareThis allows you to specify defaults if your action does not write. Inthe majority of cases they will be none, but this allows simple (static)arbitrary values. This specifically helps with the branching case --e.g. where you have two options, and want to null out anything itdoesn't write. For instance, an error and a result -- you'll only everproduce one or the other.This works both in the function and class-based approaches -- in thefunction-based it is part of the two decorators(@action/@streaming_action). In the class-based it is part of the class,overriding the default_reads and default_writes property functionWe add a bunch of new tests for default (as the code to handle multipleaction types is fairly dispersed, for now), and also make the naming ofthe other tests/content more consistent.Note that this does not currently work with settings defaults toappend/increment operations -- it will produce strange behavior.This is documented in all appropriate signatures.This also does not work (or even make sense) in the case that thefunction writes a default that it also reads. In that case, it willclobber the current value with the write value. To avoid this,we just error out if that is the case beforehand.
72f8262 to308be71Compare
This allows you to specify defaults if your action does not write. In the majority of cases they will be none, but this allows simple (static) arbitrary values. This specifically helps with the branching case -- e.g. where you have two options, and want to null out anything it doesn't write. For instance, an error and a result -- you'll only ever produce one or the other.
This works both in the function and class-based approaches -- in the function-based it is part of the two decorators
(@action/@streaming_action). In the class-based it is part of the class, overriding the default_reads and default_writes property function
[Short description explaining the high-level reason for the pull request]
Changes
How I tested this
Notes
Checklist