-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🐛 CDK: fixing type errors #9926
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
# mypy raises error 'Incompatible types in assignment (expression has type "str", variable has type "List[str]")' | ||
# type of path is first initialized as List[str] on the line 201 | ||
# however str is assigned on the line below, it causes error | ||
# to avoid code changing it was ignored for resolving issue CDK: typing errors #9500 | ||
path = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) # type: ignore | ||
pathes.add(path) |
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.
# mypy raises error 'Incompatible types in assignment (expression has type "str", variable has type "List[str]")' | |
# type of path is first initialized as List[str] on the line 201 | |
# however str is assigned on the line below, it causes error | |
# to avoid code changing it was ignored for resolving issue CDK: typing errors #9500 | |
path = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) # type: ignore | |
pathes.add(path) | |
path_str = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) # type: ignore | |
pathes.add(path_str) |
# mypy raises error 'Incompatible return value type (got "Set[List[str]]", expected "Set[str]")' | ||
# path is added into pathes, type of path is initialized as List[str] on the line 201 | ||
# however Set[str] is expected returned type | ||
# to avoid code changing it was ignored for resolving issue CDK: typing errors #9500 | ||
return pathes # type: ignore |
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.
# mypy raises error 'Incompatible return value type (got "Set[List[str]]", expected "Set[str]")' | |
# path is added into pathes, type of path is initialized as List[str] on the line 201 | |
# however Set[str] is expected returned type | |
# to avoid code changing it was ignored for resolving issue CDK: typing errors #9500 | |
return pathes # type: ignore | |
return pathes |
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.
see my comments
# to avoid code changing it was ignored for resolving issue CDK: typing errors #9500 | ||
path = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) # type: ignore | ||
pathes.add(path) | ||
path_str = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) # type: ignore |
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.
path_str = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) # type: ignore | |
path_str = "/".join([p for p in path[:-1] if p not in ["properties", "oneOf"]]) |
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.
please remove all unnecessary mypy silencing directives
/publish-cdk dry-run=false
|
What
Running mypy airbyte_cdk returns 46 typing errors. Fixing the issues.
Closes #9500
How
Fixing part of the issues. Fixing part of the issues, e.g, module "json" is not valid as a type.