Skip to content

🐛 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

Merged
merged 10 commits into from
Feb 14, 2022
Merged

Conversation

vitaliizazmic
Copy link
Contributor

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.

@vitaliizazmic vitaliizazmic added this to the Connectors Jan 28 2022 milestone Jan 31, 2022
@vitaliizazmic vitaliizazmic self-assigned this Jan 31, 2022
@github-actions github-actions bot added the CDK Connector Development Kit label Jan 31, 2022
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 2, 2022 14:55 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 7, 2022 19:14 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 7, 2022 19:33 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 7, 2022 21:07 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 7, 2022 21:21 Inactive
Comment on lines 210 to 215
# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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)

Comment on lines 218 to 222
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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

Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments

@vitaliizazmic vitaliizazmic requested a review from keu February 10, 2022 07:07
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 10, 2022 07:08 Inactive
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"]])

Copy link
Contributor

@keu keu left a 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

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 14, 2022 06:36 Inactive
@vitaliizazmic vitaliizazmic requested a review from keu February 14, 2022 06:39
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Feb 14, 2022

/publish-cdk dry-run=false

🕑 https://github.com/airbytehq/airbyte/actions/runs/1839547498
https://github.com/airbytehq/airbyte/actions/runs/1839547498

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 14, 2022 06:40 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets February 14, 2022 06:40 Inactive
@vitaliizazmic vitaliizazmic merged commit 9360508 into master Feb 14, 2022
@vitaliizazmic vitaliizazmic deleted the vitalii/9500_cdk_mypy_errors_fix branch February 14, 2022 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CDK: typing errors
5 participants