burr icon indicating copy to clipboard operation
burr copied to clipboard

Adds default reads/writes to burr actions

Open elijahbenizzy opened this issue 1 year ago • 0 comments

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

  • [ ] PR has an informative and human-readable title (this will be pulled into the release notes)
  • [ ] Changes are limited to a single goal (no scope creep)
  • [ ] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • [ ] Any change in functionality is tested
  • [ ] New functions are documented (with a description, list of inputs, and expected output)
  • [ ] Placeholder code is flagged / future TODOs are captured in comments
  • [ ] Project documentation has been updated if adding/changing functionality.

elijahbenizzy avatar Jul 16 '24 18:07 elijahbenizzy