botify-labs / simpleflow

Python library for dataflow programming.
https://botify-labs.github.com/simpleflow/
MIT License
68 stars 24 forks source link

Fix "retry" in simpleflow History #425

Open jbbarth opened 11 months ago

jbbarth commented 11 months ago

~This PR is based on #423, so please only review the last 2 commits (I wish I had a better way to do that, see #424)~

The "retry" count in simpleflow's History model is wrong:

This PR:

ewjoachim commented 11 months ago

It's sure that it would be nice if we didn't have to keep to equivalent properties. I guess there might be a way to only keep a single value and use getter/setters to expose the other one. But it's probably going to be highly overengineered compared to your solution. It's just that I'm afraid we may end up in cases where they're out of sync, especially if there's client code interacting with those.

So I'd say OK, but I think we'll may need to change details here and there in our own code in relation to this. I'd suggest we do this in a different release, after the boto thing.

jbbarth commented 11 months ago

@ewjoachim honestly I would keep only "attempts" as it's semantically clearer than "retry", BUT I'm afraid of breaking in some usages. If you're not afraid of breaking (I know for a fact it's not used in Webflow, and I doubt you use the history in the Botify codebase...) we can get rid of it?

Also we used to love dicts, I agree that some dataclasses with more intelligent serialisation would be great.