metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

Handle conflicts between class attributes and artifacts

Open tuulos opened this issue 4 years ago • 2 comments

Class attributes override artifacts, which can be confusing. In this example, the value of myval is 1, not 5, in steps after start. We should show a warning or handle this better.

class MyFlow(FlowSpec):
    myval = 1
    @step
    def start(self):
        self.myval = 5

tuulos avatar Jan 22 '21 23:01 tuulos

I guess this is fixed and flow fails in such a case. Can this be closed?

raise AttributeError(
2023-04-09 03:43:26.784 [1681004606440465/start/1 (pid 44888)] AttributeError: Flow level attributes and Parameters are not modifiable

bsridatta avatar Apr 09 '23 01:04 bsridatta

This is indeed throwing an exception now when trying to reassign class attributes. The original bug is covered, though it is not the greatest user experience as the exception is only raised during step execution, which is quite late in the lifecycle.

saikonen avatar Aug 30 '23 10:08 saikonen