metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

Better error message for @project without explicit arguments

Open emattia opened this issue 2 years ago • 1 comments

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").

emattia avatar May 18 '23 20:05 emattia

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.

bhogan-bdai avatar Feb 01 '25 00:02 bhogan-bdai