chore/schema handshake metadata pt2 #74
Merged
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.
Why
Follow-up to #72 to account for
schema.json
files without metadata.What changed
If the
handshakeSchema
field is defined, then the parameter is required. Otherwise, the parameter isLiteral[None]
, which matches the previous behavior of the default.Due to the metadata field now being required, I had to remove the
= None
default parameter. I think this is alright.It'll mean that #73 will likely need to change to
handshake_metadata_factory: HandshakeType | Callable[[], Awaitable[HandshakeType]]
to avoidasync def stub() -> None: return None
just to satisfy the async requirement. It's somewhat challenging to capture the exact semantics we want here, but I think that's alright.Test plan
Do typechecks pass?