Skip to content
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

Module "geojson_pydantic" does not explicitly export attribute "Polygon"; implicit reexport disabled #51

Closed
farridav opened this issue Mar 18, 2022 · 2 comments · Fixed by #52

Comments

@farridav
Copy link
Contributor

When using this package in the following way:

from geojson_pydantic import Feature, Polygon
from pydantic import BaseModel

class MyModel(BaseModel):
    geojson: Feature[Polygon, dict]

and running mypy i seem to get the following errors:

schemas.py:5: error: Module "geojson_pydantic" does not explicitly export attribute "Feature"; implicit reexport disabled
    from geojson_pydantic import Feature, Polygon
    ^
schemas.py:5: error: Module "geojson_pydantic" does not explicitly export attribute "Polygon"; implicit reexport disabled
    from geojson_pydantic import Feature, Polygon
    ^
Found 2 errors in 1 file (checked 8 source files)

Am i using this in the right way ? the code behaves as expected, but the type declaration doesnt like me using the types from the main package, should i explicitly import them from their source location ?

@geospatial-jeff
Copy link
Contributor

geospatial-jeff commented Mar 19, 2022

I think this is happening because we aren't using __all__ to specify what is exported by each module. This would be a good addition.

@farridav
Copy link
Contributor Author

See #52 for fix, feel free to tweak it if necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants