metaflow
metaflow copied to clipboard
Better error message for @project without explicit arguments
There is a confusing error to do with the @project decorator.
metaflow.decorators.BadFlowDecoratorException: Decorator 'project' can be applied only to FlowSpecs. Make sure the decorator is above a class definition.
This is what the offending Flow decorator looks like:
@project("XYZ")
class TaxiFarePrediction(FlowSpec):
The actual problem is that the argument should be fully specified like name=XYZ.
A more helpful error message:
The 'name' argument in the 'project' decorator must be specified like @project(name="XYZ").
Coming here to say that this issue was found via a search. It was the only way I noticed the missing kwarg structure of the call.
My decorator was on the FlowSpec, but this error seemed to claim that it wasn't.