Skip to content

module google.cloud has no attribute firestore - Incorrect #12985

Closed as not planned
@adamcunnington-mlg

Description

@adamcunnington-mlg

Bug Report

module google.cloud has no attribute firestore
The bug is that this statement is not true.

There have been a few related stackoverflow issues (e.g. 1, 2) relating to incorrect "module x as no attribute y" specifically relating to google.cloud.
Some issues were sorted by recreating the virtual env.
Other issues on this repo were historically traced back to using incremental mode but solution seemed incomplete (e.g. 1, 2).
We disabled mypy cache (e.g. incremental mode) which dealt with a chunk of the problem

To Reproduce
Hard to know exactly how to reproduce because the problem with this issue is it seems random and indeterministic - even after disabling incremental mode.

All I can tell you is in our code we do:

from google.cloud import bigquery, firestore

Both google-cloud-bigquery and google-cloud-firestore are in setup.cfg/requirements.txt and installed in the virtual environment which mypy is being activated from.

We have no issues (currently) with the bigquery import but we do with firestore. They are completely identical for all intents and purposes here.

Expected Behaviour

No complaint about missing attribute.

Actual Behaviour

Incorrect complaint about missing attribute.

Your Environment

mypy 0.950 (compiled: yes)
python 3.9.x

Please can we get to the bottom of this once and for all?

Metadata

Metadata

Assignees

Labels

bugmypy got something wrong

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions