-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix MyPy Errors for Qubole provider. #20319
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
|
One test is failed, but it is |
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 found a better? way of handling it. I think it's a bit nicer:
def execute(self: BaseOperator, context=None) -> None: # type: ignore[misc]
It's not as spectacular as in my case where I got rid of 5 self.* references this way, but I think it is more explicit (the ignore above has to be added silence another MyPy error "BaseOperator is not a superclass of Mixin'
https://github.com/apache/airflow/pull/20329/files#r770023071
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.
Nice solution :)
It is very similar to using Protocol but without protocol. Unfortunately, it doesn't work for me.
In this case, BaseOperator hasn't method get_hook as well as none of the super classes have execute method.
I think might be cases where some class inherits from mixin and two other classes and these classes have such different attributes and can't be reduced to one. But it will be another story.
Thanks for the suggestion
|
Indeed - some instability of external APIs used for tests (have a number of those in my case) - but I think it would be nice to fix the Mixin problem in the way I found :) |
|
So I see that |
0610247 to
023e26e
Compare
023e26e to
c56b0b6
Compare
Fix MyPy Errors for Qubole provider.
related: #19891