Skip to content

Issue with typing in v0.12.0 #667

@bvlasyuk-cw

Description

@bvlasyuk-cw

I have recently upgraded aiocache from 0.11 to 0.12 and after that mypy(v1.0) raised these errors below:

app/**.py:45: error: "Cache" has no attribute "get"  [attr-defined]
app/**y.py:65: error: "Cache" has no attribute "exists"  [attr-defined]
app/**.py:66: error: "Cache" has no attribute "expire"  [attr-defined]
app/**.py:74: error: "Cache" has no attribute "set"  [attr-defined]

You can see in code below some usage of aiocache inside my service method:

etag = file_metadata["ETag"]
if await self._cache.exists(etag):  # if file exists in cache we should update expire date
    await self._cache.expire(etag, self.storage_key_cache_timeout)
    return etag

Aslo when I downgrade aiocache from 0.12 to 0.11, It will work without any errors. So, I think the new version of aiocache has some issues with typing.

This is not critical issue, but I expect that someone can resolve it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions