You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an already-existing entity is defined with a function, its previous declaration (including any protocol, docstring, etc.) is erased. This is intended behavior, but it can be surprising -- especially since it's only mentioned in passing in the docs. (It's also mentioned in the docstring of FlowBuilder.__call__, but that doesn't show up anywhere in our documentation.)
Here's a minimal test that a new user might expect to pass, but doesn't:
Have different decorator APIs for defining new entities vs redefining existing ones, like we do with assign and set. This would hopefully make it more obvious that the new definition completely erases the previous one.
Change the semantics from "overwrite previous entity and create new one" to "change the value definition of an existing entity, but keep the previous protocol, docstring, etc."
The text was updated successfully, but these errors were encountered:
When an already-existing entity is defined with a function, its previous declaration (including any protocol, docstring, etc.) is erased. This is intended behavior, but it can be surprising -- especially since it's only mentioned in passing in the docs. (It's also mentioned in the docstring of
FlowBuilder.__call__
, but that doesn't show up anywhere in our documentation.)Here's a minimal test that a new user might expect to pass, but doesn't:
There are a few ways we could improve this:
assign
andset
. This would hopefully make it more obvious that the new definition completely erases the previous one.The text was updated successfully, but these errors were encountered: