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

Implement PIN 6 #915

Closed
cicdw opened this issue Apr 8, 2019 · 3 comments
Closed

Implement PIN 6 #915

cicdw opened this issue Apr 8, 2019 · 3 comments
Labels
enhancement An improvement of an existing feature

Comments

@cicdw
Copy link
Member

cicdw commented Apr 8, 2019

https://docs.prefect.io/guide/PINs/PIN-6-Remove-Constant-Tasks.html

Basically, to remove the auto-generation of "Constant" task and instead store constants in the flow object.

@cicdw cicdw added the enhancement An improvement of an existing feature label Apr 8, 2019
@cicdw cicdw added this to the v0.5.2 milestone Apr 8, 2019
@cicdw cicdw self-assigned this Apr 8, 2019
@cicdw
Copy link
Member Author

cicdw commented Apr 9, 2019

@jlowin I have a different proposal for how to implement this, based on mapping over a constant list:

add_one.map(x=[1, 2, 3])

With this use case in mind, it's easier to implement a special Edge property called upstream_constant or something, which tracks whether the upstream task is a constant or not. In fact, we could compute this on the fly by checking whether the upstream is a Task instance or not. Alternatively, a new initialization kwarg which holds an upstream_constant instead of an upstream_task.

Implemented this way, the information is still contained entirely within the Flow, but it also allows for edges such as

Edge(upstream_constant=[1, 2, 3], downstream_task=add_one, key='x', mapped=True)

which handle mapping over constants.

@cicdw cicdw modified the milestones: v0.5.2, Future Apr 10, 2019
@cicdw cicdw removed their assignment Apr 10, 2019
@jlowin jlowin mentioned this issue Apr 11, 2019
3 tasks
@jlowin
Copy link
Member

jlowin commented Apr 11, 2019

Following offline conversation in which we realized that any attempt to modify Edge objects would essentially reimplement Constant Tasks by another name, we've decided to decline PIN 6 (for now) -- See #917

@cicdw
Copy link
Member Author

cicdw commented Apr 11, 2019

Closed via #915

@cicdw cicdw closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants