Skip to content

[FEAT] Make read_json refuse a __class__ that is not a chainladder estimator #1628

Open

Description

@scks1

Follow-up to #1569, split out of #1606 as separate scope. read_json looks up __class__ in the chainladder namespace, so it accepts any object there: {"__class__": "load_sample", "params": {}} calls load_sample() and raises a TypeError about the missing argument. Nested estimators, such as BerquistSherman's reported_count_estimator, are loaded the same way.

Proposal: raise a ValueError naming the __class__ when it is not a chainladder estimator class, at the top level, for each pipeline step and for nested estimators, and run the parameter check from #1606 on the nested estimators as well.

(This issue was written with Árbol, an AI assistant, under my direction.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    Low

    Scope

    Codebase

    Effort

    Medium

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions