Skip to content

DISC: Use of assertions in user-facing code #37350

Closed
@dsaxton

Description

@dsaxton

There are a variety of places in the code base where we have some bare assertions that can be somewhat confusing when encountered by end-users (e.g., #35509). As @WillAyd pointed out these are sometimes useful in convincing mypy of something's type, but is this nonetheless something we want to avoid as a general rule? If indeed the assertion is valid then it shouldn't actually raise, but if it can then probably we could come up with a more appropriate error type / message than an empty assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandasNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions