-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[MAINTENANCE] mypy
config update
#6589
Changes from all commits
8f23203
b2d82cd
72ee14c
3c3243a
f71e3fb
9d55f77
57f1570
b434b6a
08a1671
6deaa9b
8e89d7b
929b682
8b3a119
ef6c84c
28190a4
4a10adc
a770046
440efc1
7fa6500
d228c7c
80379aa
d028e24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,24 @@ ignore_missing_imports = true | |
follow_imports = 'silent' | ||
warn_redundant_casts = true | ||
show_error_codes = true | ||
enable_error_code = [ | ||
'ignore-without-code' | ||
] | ||
# The following list of codes are globally ignored, do not add to this list | ||
disable_error_code = [ | ||
# annotation-unchecked are 'warning notes', not errors and won't cause mypy to fail | ||
# but it does create a lot of noise in the CI mypy step. | ||
# https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html | ||
'annotation-unchecked' | ||
] | ||
exclude = [ | ||
# If pattern should always be excluded add comment explaining why | ||
# BEGIN ALWAYS EXCLUDE SECTION ##################################################### | ||
# If pattern should always be excluded add comment explaining why and put | ||
'docs/', # Docs should not be type checked with the rest of the library. | ||
'_version\.py', # generated by `versioneer` | ||
'v012', # legacy code | ||
# END ALWAYS EXCLUDE SECTION ###################################################### | ||
# | ||
# ################################################################################# | ||
# TODO: complete typing for the following modules and remove from exclude list | ||
# number is the current number of typing errors for the excluded pattern | ||
|
@@ -70,7 +84,6 @@ exclude = [ | |
'core/usage_statistics/usage_statistics\.py', # 19 | ||
'core/usage_statistics/util\.py', # 2 | ||
'core/util\.py', # 18 | ||
'docs/', # Docs should not be type checked with the rest of the library. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anthonyburdi |
||
'dataset/sparkdf_dataset\.py', # 3 | ||
'dataset/sqlalchemy_dataset\.py', # 16 | ||
'datasource/data_connector/configured_asset_sql_data_connector\.py', # 47 | ||
|
@@ -155,7 +168,6 @@ exclude = [ | |
'rule_based_profiler/parameter_builder/value_set_multi_batch_parameter_builder\.py', # 2 | ||
'rule_based_profiler/parameter_container\.py', # 7 | ||
'rule_based_profiler/rule_based_profiler\.py', # 40 | ||
'tasks\.py', # Excluded from type checking the rest of the library, may be added in a separate step. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anthonyburdi why were we ignoring this file? We should opt to suppress the specific errors if they are unresolvable rather than ignore the whole file. |
||
'validation_operators/types/validation_operator_result\.py', # 35 | ||
'validation_operators/validation_operators\.py', # 16 | ||
'validator/exception_info\.py', # 1 | ||
|
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.
Just want to call out that I am globally disabling this "error" code, which we should generally never do.
But in this case, this "error" code doesn't actually result in an error anyways, so it wouldn't actually prevent any bugs without an additional configuration setting like
check-untyped-defs
See the recent mypy release post section titled Warn about Variable Annotations in Unchecked Functions for these details.
If anyone has an issue with this let's discuss it.
Also, I initially turned on
check-untyped-defs
with the idea that if the number of errors was low, I would just fix them but... I ended up getting about200
new errors 😬 .I do think we should revisit this once we have better coverage of our existing "typed defs".