Add cached function returning output and metadata#32
Conversation
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
cached function returning output and metadata
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Done in commit a49988e:
This eliminates code duplication while maintaining the same user-facing behavior for Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Make the code we run consistent with the cached case, e.g., compute `whenrun` before running `f`, etc.
Not needed now that we test the metadata returned by cached
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #32 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 57 72 +15
=========================================
+ Hits 57 72 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dahong67
left a comment
There was a problem hiding this comment.
@copilot I've gone through and revised/polished. I think these are now good to go! One thing left to do is to add a very brief example of this to the README. Add it to the end of the "Function form" section. Please do not modify any other files at this point, only README.md.
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Added in commit 9170f9d. I've added a brief example of the |
dahong67
left a comment
There was a problem hiding this comment.
Looks good, I think we're all set!
Implementation Changes
cachedfunctioncacheto usecachedinternallycachedcachedto READMESummary
The
cachedfunction now operates silently without log messages, returning only the NamedTuple with value and metadata. Thecachefunction has been refactored to callcachedinternally, adding the log messages on top before returning just the value. This eliminates code duplication while maintaining the same behavior forcache.A brief example demonstrating the
cachedfunction has been added to the README at the end of the "Function form" section.Original prompt
cachedfunction #29✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.