-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: Added an extensible API for stream schema sources #2876
base: main
Are you sure you want to change the base?
feat: Added an extensible API for stream schema sources #2876
Conversation
Reviewer's Guide by SourceryThis PR introduces an extensible API for stream schema sources by adding support for loading JSON schemas from both local files and OpenAPI specifications. The changes are implemented by creating a new module that defines a base schema source along with two subclasses (LocalSchemaSource and OpenAPISchemaSource) that handle the respective schema loading logic. Additionally, tests and sample stream implementations have been updated to utilize the new API. Class diagram for the new schema source APIclassDiagram
class BaseSchemaSource {
- path
- _registry : dict<string, dict>
+ __init__(path: str | Path | Traversable)
+ get_schema(...args): dict
+ __call__(...args): dict
}
class LocalSchemaSource {
+ get_schema(name: str): dict
}
class OpenAPISchemaSource {
+ get_schema(ref: str): dict
+ spec_dict : dict <<cached property>>
}
BaseSchemaSource <|-- LocalSchemaSource
BaseSchemaSource <|-- OpenAPISchemaSource
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2876 +/- ##
=======================================
Coverage 91.33% 91.33%
=======================================
Files 62 62
Lines 5203 5203
Branches 675 675
=======================================
Hits 4752 4752
Misses 319 319
Partials 132 132 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #2876 will not alter performanceComparing Summary
|
f5efa08
to
99e2c00
Compare
99e2c00
to
282ad28
Compare
Summary by Sourcery
Introduce an extensible API for stream schema sources.
New Features:
LocalSchemaSource
to load schemas from local files.OpenAPISchemaSource
to load schemas from OpenAPI specs.Tests:
LocalSchemaSource
andOpenAPISchemaSource
.📚 Documentation preview 📚: https://meltano-sdk--2876.org.readthedocs.build/en/2876/