zlacker

[parent] [thread] 4 comments
1. krawcz+(OP)[view] [source] 2024-03-08 23:44:46
Can you explain why you chose every function to take in context? https://github.com/hatchet-dev/hatchet/blob/main/python-sdk/...

This seems like a lot of boiler plate to write functions with to me (context I created http://github.com/DAGWorks-Inc/hamilton).

replies(1): >>abelan+Fo
2. abelan+Fo[view] [source] 2024-03-09 04:46:47
>>krawcz+(OP)
We did it because there are methods that should be accessed which don't map to `args` cleanly. For example, we let users call `context.log`, `context.done` (to determine whether to return on cancellation) or `context.step_output` (to dynamically access a parent's step output). Perhaps there's a more pythonic way to do this? Admittedly this is a pattern we adapted from Go.
replies(2): >>kamika+Cp >>krawcz+Du
◧◩
3. kamika+Cp[view] [source] [discussion] 2024-03-09 05:01:53
>>abelan+Fo
Probably just have it attached to self, like self.context

But nbd IMHO

replies(1): >>krawcz+Mu
◧◩
4. krawcz+Du[view] [source] [discussion] 2024-03-09 06:21:35
>>abelan+Fo
you could just make them optional arguments that you inject if they're declared. Happy to chat more. With Hamilton we could actually build an alternative way to describe your API pretty easily...
◧◩◪
5. krawcz+Mu[view] [source] [discussion] 2024-03-09 06:23:05
>>kamika+Cp
yep nbd, but :/
[go to top]