-
Notifications
You must be signed in to change notification settings - Fork 74
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
Typed State #350
Merged
Merged
Typed State #350
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
from
September 2, 2024 06:54
3eea854
to
445ff0c
Compare
OK, TODO before this is: Ready for feedback
Ready to publish
If time
|
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
3 times, most recently
from
September 2, 2024 21:22
a3c981d
to
a6db463
Compare
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
10 times, most recently
from
September 10, 2024 21:24
35d4257
to
b03b85c
Compare
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
2 times, most recently
from
September 11, 2024 22:46
d13284b
to
913936a
Compare
elijahbenizzy
commented
Sep 11, 2024
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
3 times, most recently
from
September 12, 2024 04:53
d503827
to
0c2f673
Compare
This has qwuite a few pieces to it: 1. Adds centralized state with a typing system 2. Adds decentralized state 3. Adds pydantic implementations See issue #139 for more details on design decisions
This is just a Quick wrapper class to represent a schema. Note that this is currently used internally, just to store the appropriate information. This does not validate or do conversion, currently that is done within the pydantic model state typing system (which is also internal in its implementation). We will likely centralize that logic at some point when we get more -- it would look something like this: 1. Action is passed an ActionSchema 2. Action is parameterized on the ActionSchema types 3. Action takes state, validates the type and converts to StateInputType 4. Action runs, returns intermediate result + state 5. Action validates intermediate result type (or converts to dict? Probably just keeps it 6. Action converts StateOutputType to State Also we don't have this split out into two classes (input/output schema), but we will likely do that shortly.
This is just syntactic sugar so we can call @action.pydantic(...). This does some tricky importing stuff, but does not change the required packages in any way
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
from
September 12, 2024 23:27
3624a3c
to
74cee32
Compare
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
) | ||
``` | ||
|
||
Note that this should exactly model your state -- we need to make things optional, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note that this should exactly model your state -- we need to make things optional, | |
Note (1): what is defined here, should exactly model all the fields required for your application to function. Note (2): we need to make fields optional in most situations, |
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
reviewed
Sep 14, 2024
skrawcz
approved these changes
Sep 14, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my edits. otherwise looks good as discussed!
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
from
September 15, 2024 19:28
edc16da
to
104fcfa
Compare
elijahbenizzy
force-pushed
the
typed-state-prototype
branch
from
September 15, 2024 20:39
104fcfa
to
8048275
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Learnings:
Some magic around subsetting that we have to test, see how it interacts with pydantic validation
Changes
How I tested this
Notes
Checklist