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
SAT: Relax checking of oneOf
common property and allow optional default
keyword additional to const
keyword
#16172
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
oneOf
common property and allow optional default
keyword additional to const
keyword
@grubberr can we skip the pydantic major version upgrade for now? I don’t know the impact of allowing default on OneOf in the UI |
I have put this PR on-hold until we understand how to be with new |
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@grubberr is there a way to modify pydantic behavior instead? It seems like the wrong choice to modify all of the Airbyte Protocol expectations because a python library changed an implementation detail. My understanding is that this will cause a suboptimal UI experience. Randomly selecting @tealjulia to confirm. Would adding the enum keyword to the oneOf blocks cause issues in the Ui? |
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
/test connector=bases/source-acceptance-test
Build PassedTest summary info:
|
@sherifnada I have double checked pydentic PR(s) and Issue(s) about that problem with pydantic/pydantic#4031 I see that pydentic team thinks that old behaviour (without |
Is my understanding correct that this should not change any existing frontend behavior and we'd continue reading the same keyword in the spec? @grubberr @sherifnada If that is the case I believe this will not cause issues. The frontend types for connectors trust what the connector sends us and this appears to be solely an additive change. I tested it out locally in Storybook (our frontend component library) and the form is still able to at least render with the additional keyword in the spec. I strongly recommend this be manually tested in the UI to ensure that all of the user interaction still works as expected. This could be achieved by:
I have not done this as I'm only sure how to do step 1 (would like to know how to do step 2, if someone can point me in the right direction I can try it out). Another conservative measure would be to add a test to the frontend code where we parse the specs to ensure that it handles a spec with this keyword as expected (which, if I understand correctly, we should just ignore?). Happy to help get that in place. I agree, I'd really rather be safe than sorry in ensuring users can setup their connectors. |
@grubberr is there a way to override this behavior in Pydantic? If not, let's follow Teal's advice above:
|
@sherifnada |
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.
@grubberr sounds fine with me, we'll need to follow the steps above to move this change forward
Signed-off-by: Sergey Chvalyuk grubberr@gmail.com
What
We have requirement for all
oneOf
common properties to use onlyconst
keyword withoutdefault
andenum
keywords like this:BUT new
pydentic==1.10.0
after this PR pydantic/pydantic#4152started to generate json-schemas with
default
keyword like this:How
I propose to be compatible with
pydantic>=1.10.0
and not forbiddefault
keyword in such common properties.