metaflow
metaflow copied to clipboard
Handle conflicts between class attributes and artifacts
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
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
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.