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

Add target parameter to pipe_input #1161

Open
elijahbenizzy opened this issue Sep 30, 2024 · 2 comments
Open

Add target parameter to pipe_input #1161

elijahbenizzy opened this issue Sep 30, 2024 · 2 comments

Comments

@elijahbenizzy
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently it assumes the first parameter. But that's a bit silly, we should use a target parameter. That would also allow pipe_input to work with other decorators cleanly.

Describe the solution you'd like

@pipe_input(
    step(...),
    step(...),
    target="b" # applies to parameter `b`
)
def foo(a: int, b: int) -> int:
    ...

Describe alternatives you've considered
Not doing this or just reordering parameters for the user.

Additional context
Tangentially related to this: #1160

@zilto
Copy link
Collaborator

zilto commented Oct 2, 2024

Nitpick: should it be target or target_. Both are present in the codebase (from_.parquet(..., target="raw_data"), @tag(..., target_="field_b"))

@elijahbenizzy
Copy link
Collaborator Author

Nitpick: should it be target or target_. Both are present in the codebase (from_.parquet(..., target="raw_data"), @tag(..., target_="field_b"))

We use target_ for anything tag-related. E.G. with **kwargs so we don't hit namespacing issues with arbitrary tags (which could be called target). In this case it's not **kwargs, so I think target is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants