feat: v5 basics#49
Merged
Merged
Conversation
Merged
This file contains hidden or 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
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.
Jira Ticket
Usage example - plain
Usage example - with Schema
Info
base.pycontains a BaseResource class, which is inherited by relevant handlers for different filetypes, (and coming, S3, postgres and kafka). Because BaseResource itself is a pydantic model we have typechecking on-use.To inject variables into resources you can either use f-strings, or use the
injectmethod.If you want to go with the 'chuck it all in' approach, I would recommend something like this
resource.inject(os.environ)Usage - Testing
For different environments during testing feel free to use the keyed resource. In upcoming releases testing will be handled differently and keyed resources should only be used when needing a different dev setup or similar shenanigans.
Note
This is a first sample, to raise any architecture/api concerns. Things to follow include All other IO methods, more tests, logging/metrics capabilities, extra validations and migration scripts and other cli features.