-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Update source-gnews manifest to use inline stream schemas #20405
Conversation
2a994f6
to
1d073ae
Compare
f3d0a00
to
71782a8
Compare
5bbfe37
to
625d612
Compare
2624e82
to
14e30e9
Compare
@@ -1,5 +1,109 @@ | |||
version: "0.1.0" | |||
|
|||
schemas: | |||
search_stream_schema: | |||
"$schema": http://json-schema.org/draft-07/schema# |
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.
do we need this line? I think it makes sense at the top level of a yaml file to specify the version of jsonschema to use to validate, but I doubt it does anything here
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.
Ah, that can be removed. Just kept it in so I could diff the output of discover
before and after the schema was included inline in the manifest.
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.
@girarda just pushed the update removing these lines. Did you want to review the change?
df526c5
to
4e8a721
Compare
/test connector=connectors/source-gnews
Build FailedTest summary info:
|
4e8a721
to
f326718
Compare
@@ -44,7 +146,12 @@ definitions: | |||
nullable: "{{ ','.join(config['nullable']) }}" | |||
from: "{{ stream_slice['start_time'] }}" | |||
to: "{{ stream_slice['end_time'] }}" | |||
schema_loader: | |||
type: StaticSchemaLoader |
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.
This should be InlineSchemaLoader
correct?
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.
😬 yep! Fixed.
@@ -6,7 +6,7 @@ | |||
from setuptools import find_packages, setup | |||
|
|||
MAIN_REQUIREMENTS = [ | |||
"airbyte-cdk~=0.1", | |||
"airbyte-cdk~=0.13.2", |
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.
We should remove the patch version from here. Right now, this will cause us to only pull the airbyte-cdk
from 0.13.x
onward as per PEP 440. Whereas ideally we probably want to continue to get minor bumps as the CDK continues to be changed in a non-breaking way.
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.
@brianjlai this change does rely on CDK version 0.13.2 or greater. WDYT about changing it to airbyte-cdk>=0.13.2
?
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.
I agree that we should definitely pin it to use 0.13
or above since it relies on a new feature, but the problem with explicitly marking it with the patch version 2
is that next time we build, we will only pull airbyte-cdk
where minor version is 13
. So in the next month if we progress to CDK 0.20.0
, this connector will continue to be pinned at 0.13.x
since it will only look for the latest patch. And I think based on PEP 440 ~=
and >=
are interchangeable. Basically I think we want to continue to get latest minors and specifying a patch in setup.py will inhibit that.
And actually given that this is a new non-breaking feature, we should probably also be bumping this to 0.14.0
.
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.
Got it, thanks for clarifying. Sounds like I should have bumped the CDK change to 0.14.0
. Looks like that does exist now so I'll change this to use airbyte-cdk~=0.14
.
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.
ah sorry my bad, I was getting some PRs mixed. Up this was more that in hindsight that we should've minor version bumped the cdk schema change to 14 since it was a feature add. But regardless 0.14.0
is still fine since that was released earlier today.
@@ -1,5 +1,107 @@ | |||
version: "0.1.0" | |||
|
|||
schemas: |
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.
nit, but can we move the schemas to the bottom of the file? i think the definitions and streams are likely to be the parts of the manifest that change most, so it's more intuitive to have them at the top.
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.
ah sorry you are correct and my mistake. I thought we did some preparsing to allow for forward references even if defined after, but doesn't seem like we do, so it's fine to have this at the top.
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.
No worries (sorry, deleted my comment because I thought maybe I'd spoken prematurely and was looking more closely at the issue). Going to write up an issue for updating the parser to handle forward references, since I do think that will make the yaml more readable.
f326718
to
5d5e5a5
Compare
search_stream: | ||
schema_loader: | ||
$ref: "*ref(definitions.schema_loader)" |
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.
fwiw I would find it more understandable if this said
schema_loader:
type: InlineSchemaLoader
instead of the ref
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.
Updated.
@girarda @brianjlai @sherifnada did you want to rereview this? It needs an approval to merge, since we don't want to wait on the potential forward reference change. |
@clnoll no review needed from me! I just happened to see that one line where I made a comment :) |
/test connector=connectors/source-gnews |
/publish connector=connectors/source-gnews
if you have connectors that successfully published but failed definition generation, follow step 4 here |
What
Updates the
source-gnews
low-code connector to include the stream schema inline in the manifest.See #19499.
This is blocked by #20375.
TODO: update the
airbyte-cdk
version used bysource-gnews
once #20375 has been released.How
gnews.yaml
to include a yaml version of the schema previously stored in theschemas
directory.Recommended reading order
gnews.yaml
🚨 User Impact 🚨
No breaking changes; the output of the
discover
method is the same with the inline stream schemas as it was with the on-disk schema files.Pre-merge Checklist
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog example/test connector=connectors/<name>
command is passing/publish
command described hereTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.