Skip to content

Fix typehinting errors for attribute access #84

@piercefreeman

Description

@piercefreeman

Determine whether there's a way to modify our typehinting to avoid this error on attribute access, which is valid because of our metaclass but usually not allowed in contexts like dataclass or Pydantic BaseModels.

error[unresolved-attribute]: Attribute order can only be accessed on instances, not on the class object <class 'PostConvertedImage'> itself.
--> amplify/controllers/shared/posts_common.py:87:23
|
85 | ),
86 | )
87 | .order_by(models.PostConvertedImage.order)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 | )
89 | converted_media = await db_session.exec(converted_media_query)
|
info: rule unresolved-attribute is enabled by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions