-
Notifications
You must be signed in to change notification settings - Fork 26
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
Enable MyPy in strict mode #60
Conversation
d589e60
to
52f61ee
Compare
Added |
@@ -108,7 +108,7 @@ def execute(self, context: "Context"): | |||
"Unable to pause cluster since cluster is currently in status: %s", cluster_state | |||
) | |||
|
|||
def execute_complete(self, context, event=None): | |||
def execute_complete(self, context: Dict[Any, Any], event: Optional[Dict[Any, Any]] = None) -> None: |
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.
Adding Any
everywhere doesn't help! It is same as not adding type hints at all
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.
The idea of adding type hints is so we know what type a variable/arguments/param is. Adding Any
doesn't give any info
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.
In BaseSensorOperator
, it uses Any
. That was the reason for using Any
. link
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.
Any
is only used for the return type of execute
in that link. Dict[Any, Any]
is the same as dict
This PR fixes some of the MyPy errors, a subset of #60 Co-authored-by: phanikumv <phani.kumar@astronomer.io> Co-authored-by: Pankaj <pankaj@astronomer.io> Co-authored-by: Rajath <92459020+rajaths010494@users.noreply.github.com> Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
79f6e0a
to
c26a73f
Compare
This PR fixes some of the MyPy errors, a subset of #60 Co-Authored-By: phanikumv <phani.kumar@astronomer.io> Co-Authored-By: Pankaj <pankaj@astronomer.io> Co-Authored-By: Rajath <92459020+rajaths010494@users.noreply.github.com> Co-Authored-By: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
14bf634
to
412fa42
Compare
I can see a couple of inconsistencies on which we need to conclude
|
I agree. For now, let's park it and we can discuss this next week |
Codecov Report
@@ Coverage Diff @@
## main #60 +/- ##
==========================================
- Coverage 89.92% 89.76% -0.16%
==========================================
Files 35 35
Lines 1796 1818 +22
==========================================
+ Hits 1615 1632 +17
- Misses 181 186 +5
Continue to review full report at Codecov.
|
Add deps Update Dockerfile Update Makefile Add deps Update Dockerfile Update Makefile
Remove redundant casting to boolean Fix mypy errors in databricks operator and trigger
Add mypy type for bigquery operators and fix test fail for kube
Fix mypy issues for S3KeySensors hooks, operators and triggers Fix mypy issues for bigquery async Remove duplicate mypy configs Fix mypy issues for Amazon async operators and sensors
🎉 Ok, I have finally got this in !! We also have it running in the CI |
This PR fixes some of the MyPy errors, a subset of astronomer/astronomer-providers#60 Co-Authored-By: phanikumv <phani.kumar@astronomer.io> Co-Authored-By: Pankaj <pankaj@astronomer.io> Co-Authored-By: Rajath <92459020+rajaths010494@users.noreply.github.com> Co-Authored-By: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
Enable MyPy in a strict mode and run via docker instead of pre-commit so the stubs are installed.
closes #65