Skip to content

Misleading error message in flattener /catching the wrong exception #5

@dmoisset

Description

@dmoisset

At

https://github.com/machinalis/featureforge/blob/develop/featureforge/flattener.py#L197 , TypeErrors are caught. The call to next() triggers feature evaluation, and when the call to a feature raises a TypeError, that exception is caught and a ValueError("Cannot fit with an empty dataset") message is generated.

There's no reson to relaunch that exception with that message, the original exception should go through

From what I see in the history, the TypeError guard was there to catch possible problems when calling iter(...), but the call to iter() was moved outside the protected block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions