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
f"A component run spec with identifier '{self.identifier}' "
f"already exists in registry '{registry}' and differs from "
"the one being added. Use force=True to overwrite the "
"existing one."
)
This can be wrong because currently some fields in specs can be omitted when their values are None. E.g., the WebRegistry always returns an agent and environment field for ComponentRun specs, even when the value of those attributes is None.
Essentially, we currently allow any optional spec field to be either omitted from the spec OR included and set to None.
Since {x: None} == {} returns False in Python (and rightfully so!) we need a smarter way of testing specs for equality.
We should be using a hash of the specs, and in fact the identifier should probably be the hash for all spec types (as it is currently for ArgumentSet specs). This should be addressed by #253, which will probably be done as part of #250.
The text was updated successfully, but these errors were encountered:
We currently use
==
in to_registry() on many spec classes such as here inComponentRun.to_registry()
:agentos/agentos/component_run.py
Lines 120 to 125 in c59e476
This can be wrong because currently some fields in specs can be omitted when their values are None. E.g., the WebRegistry always returns an
agent
andenvironment
field forComponentRun
specs, even when the value of those attributes isNone
.Essentially, we currently allow any optional spec field to be either omitted from the spec OR included and set to None.
Since
{x: None} == {}
returns False in Python (and rightfully so!) we need a smarter way of testing specs for equality.We should be using a hash of the specs, and in fact the identifier should probably be the hash for all spec types (as it is currently for
ArgumentSet
specs). This should be addressed by #253, which will probably be done as part of #250.The text was updated successfully, but these errors were encountered: