Typing error: Type of "list" is partially unknown
miladh opened this issue ยท 8 comments
System information (please complete the following information):
- OS: Ubuntu
- Python Version: 3.9.18
- SDK Version: 7.28.2
Describe the bug
Versions after 7.28.0 (#1667) triggers the pyright error: Type of "list" is partially unknown
, for e.g.:
client.assets.list(limit=-1)
hellow can you give us a preffered output such as screenshot of how output you want
The preferred solution would be to not get the typing errors. Here is an example CI run from a renovate PR that bumped the SDK version in one of our repos, where the type-checker started to fail:
https://ci.jenkins.cogheim.net/blue/organizations/jenkins/cognitedata-ci%2Fcog-ai/detail/PR-1649/10/pipeline
By adding # type: ignore[reportUnknownMemberType]
I was able to suppress the error, see e.g. this commit.
But I believe this is something that should be fixed in SDK
I'm unable to reproduce with 3.8 and 3.9. After taking a look at the referenced repo, I don't see pylint
being an explicit dependency so I'm not sure what version of pylint
to test with (I looked at pyproject.toml
, .pre-commit-config.yaml
and the Jenkinsfile
)
I'm unable to reproduce with 3.8 and 3.9. After taking a look at the referenced repo, I don't see
pylint
being an explicit dependency so I'm not sure what version ofpylint
to test with (I looked atpyproject.toml
,.pre-commit-config.yaml
and theJenkinsfile
)
We are using pyright
as type checker.
.pre-commit-config.yaml
uses the make command py-lint
(unfortunate choice of name), which runs poetry run pyright
.
The pyright
version we are using is 1.1.354
@miladh oh, haha, I see ๐ I ran it using poetry:
poetry run pre-commit run py-lint --all-files
...but somehow it succeeds for me ๐ค Is main perhaps updated - ah of course. I checked out 085ae95a2ea3fcba75231eda683ba86dd150e903 and I get the same errors. I'll have a look tomorrow ๐
Released now! Took the liberty to make a PR as well ๐ https://github.com/cognitedata/cog-ai/pull/1709