Skip to content

CDK: fix license headers and mypy errors #8576

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

Closed
keu opened this issue Dec 7, 2021 · 1 comment · Fixed by #9037
Closed

CDK: fix license headers and mypy errors #8576

keu opened this issue Dec 7, 2021 · 1 comment · Fixed by #9037
Assignees
Labels
type/bug Something isn't working

Comments

@keu
Copy link
Contributor

keu commented Dec 7, 2021

Current Behavior

We use pre-commit to validate python code locally, currently, CDK does not pass pre-commit checks, which makes it less usable if usable at all.

Expected Behavior

The code in CDK is properly formatted and pre-commit checks are passed.

Logs

base) ➜  python git:(keu/cdk-base-pydantic-models) ✗ pre-commit run --files airbyte_cdk/sources/config.py
licenseheaders...........................................................Passed
black....................................................................Passed
isort....................................................................Passed
prettier.............................................(no files to check)Skipped
flake8...................................................................Passed
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

airbyte-cdk/python/airbyte_cdk/sources/config.py: note: In member "schema" of class "BaseConfig":
airbyte-cdk/python/airbyte_cdk/sources/config.py:60:9: error: Returning Any
from function declared to return "Dict[str, Any]"  [no-any-return]
            return schema
            ^
airbyte-cdk/python/airbyte_cdk/sources/abstract_source.py:29: note: In module imported here,
airbyte-cdk/python/airbyte_cdk/sources/__init__.py:1: note: ... from here:
airbyte-cdk/python/airbyte_cdk/sources/utils/schema_helpers.py:13:1: error:
Module 'airbyte_cdk.models' does not explicitly export attribute
'ConnectorSpecification'; implicit reexport disabled  [attr-defined]
    from airbyte_cdk.models import ConnectorSpecification
    ^
airbyte-cdk/python/airbyte_cdk/sources/utils/schema_helpers.py: note: In member "__call__" of class "JsonFileLoader":
airbyte-cdk/python/airbyte_cdk/sources/utils/schema_helpers.py:32:9: error:
Returning Any from function declared to return "Dict[str, Any]"  [no-any-return]
            return json.load(open(uri))
            ^
airbyte-cdk/python/airbyte_cdk/sources/utils/schema_helpers.py: note: In function "resolve_ref_links":
airbyte-cdk/python/airbyte_cdk/sources/utils/schema_helpers.py:47:9: error:
Returning Any from function declared to return "Dict[str, Any]"  [no-any-return]
            return obj
            ^
@augan-rymkhan
Copy link
Contributor

augan-rymkhan commented Jan 14, 2022

When running mypy check, it gives 46 errors. I opened a new issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants