Skip to content
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

@pipe decorator #398

Merged
merged 2 commits into from
Oct 19, 2023
Merged

@pipe decorator #398

merged 2 commits into from
Oct 19, 2023

Conversation

elijahbenizzy
Copy link
Collaborator

@elijahbenizzy elijahbenizzy commented Sep 28, 2023

See #65, #372

Changes

  • Add pipe decorator

How I tested this

  • Lots of testing, end-to-end included

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 elijahbenizzy force-pushed the pipe branch 3 times, most recently from 517b145 to 0af987d Compare October 16, 2023 23:41
@elijahbenizzy elijahbenizzy temporarily deployed to github-pages October 16, 2023 23:41 — with GitHub Actions Inactive
@elijahbenizzy elijahbenizzy changed the title WIP @pipe decorator Oct 17, 2023
@elijahbenizzy elijahbenizzy force-pushed the pipe branch 12 times, most recently from b556623 to 03d2803 Compare October 17, 2023 04:33
@elijahbenizzy elijahbenizzy requested a review from skrawcz October 17, 2023 04:36
tests/resources/pipe.py Outdated Show resolved Hide resolved
@skrawcz
Copy link
Collaborator

skrawcz commented Oct 18, 2023

in person conversation notes:

  • apply --> step
  • stick with named
  • get example added

@elijahbenizzy elijahbenizzy force-pushed the pipe branch 6 times, most recently from e678276 to d49d9d3 Compare October 19, 2023 05:00
@elijahbenizzy elijahbenizzy mentioned this pull request Oct 19, 2023
Copy link
Collaborator

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Commits should have more design decision whys for your future self to refer back to.

#372

`pipe` allows for function chaining/redefinition. It has a few caveats
(see the documentation + list below), but they're all placeholders -- we will have
the chance to improve it over time, as more people use it.

- uses a series of `step(fn, *args, **kwargs)` to apply functions in a row
- the first parameter is chained through to the next ones
- we only support decorating hamilton-friendly functions
  (kwargable/typed) for now
- we have an ability to make it a single node but don't do that yet

We also place in/comment out the `@flow` decorator, which
is equivalent to `pipe`, but doesn't pass the result into the next
function. Thus it can be used to build a procedural subdag as a
component of a declarative DAG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants