-
Notifications
You must be signed in to change notification settings - Fork 1.9k
chore: invoke deprecated methods in default supports method for backwards compatibility #5897
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
Conversation
… extensions backwards compatibility
default boolean supports(Class<? extends DatabaseObject> object) { | ||
if (Sequence.class.isAssignableFrom(object)) { | ||
return supportsSequences(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
if (Sequence.class.isAssignableFrom(object)) { | ||
return supportsSequences(); | ||
} else if (Schema.class.isAssignableFrom(object)) { | ||
return supportsSchemas(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
} else if (Schema.class.isAssignableFrom(object)) { | ||
return supportsSchemas(); | ||
} else if (Catalog.class.isAssignableFrom(object)) { | ||
return supportsCatalogs(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
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.
Code here looks fine but I don't know any of the context around this change.
@StevenMassaro the new support I'm adding this info to the PR description, thanks! |
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.
LGTM
TLDR:
Invoke deprecated methods in default supports method to ensure that extensions are not broken, but one day when those are removed it will return only true
Description
The new support
method
was introduced in PR #5619 so specially NoSQL databases can check for other supports asCollections
without changing Database class and adding asupportsCollections()
method.In core all the locations were
supportsSequences()
existed were changed to supports(Sequence) , and all *Database classes had this new method implemented. But extensions don't have it, so they could return the wrong value. For instance, BigQuery doesn't support sequences but would start to return true to core.With this fix we continue to return what is expected.
Impact