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
Error executing job with overrides: []
Traceback (most recent call last):
File "/home/scotts/svnrepos/repo3/MCLS_008/src/scripts/simple_hydra.py", line 19, in <module>
zen(task, instantiation_wrapper=pydantic_parser).hydra_main(
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra_zen/wrapper/_implementations.py", line 532, in hydra_main
return hydra.main(**kw)(target)()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/main.py", line 94, in decorated_main
_run_hydra(
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
_run_app(
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/utils.py", line 457, in _run_app
run_and_report(
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/utils.py", line 223, in run_and_report
raise ex
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
return func()
^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/utils.py", line 458, in <lambda>
lambda: hydra.run(
^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/hydra.py", line 132, in run
_ = ret.return_value
^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/core/utils.py", line 260, in return_value
raise self._return_value
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/core/utils.py", line 186, in run_job
ret.return_value = task_function(task_cfg)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra_zen/wrapper/_implementations.py", line 451, in __call__
name: self.instantiate(val) if is_instantiable(val) else val
^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra_zen/wrapper/_implementations.py", line 375, in instantiate
__c = instantiate(__c, _target_wrapper_=self._instantiation_wrapper)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra_zen/_hydra_overloads.py", line 341, in instantiate
return hydra_instantiate(config, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 226, in instantiate
return instantiate_node(
^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 347, in instantiate_node
return _call_target(_target_, partial, args, kwargs, full_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra_zen/_hydra_overloads.py", line 105, in _call_target
_target_ = target_wrapper(_target_)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/hydra_zen/third_party/pydantic.py", line 117, in pydantic_parser
return cast(_T, parser(_constructor_as_fn(target)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/pydantic/validate_call_decorator.py", line 56, in validate
validate_call_wrapper = _validate_call.ValidateCallWrapper(function, config, validate_return, local_ns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py", line 57, in __init__
schema = gen_schema.clean_schema(gen_schema.generate_schema(function))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py", line 512, in generate_schema
schema = self._generate_schema_inner(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py", line 789, in _generate_schema_inner
return self.match_type(obj)
^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py", line 856, in match_type
return self._callable_schema(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py", line 1670, in _callable_schema
sig = signature(function)
^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/inspect.py", line 3310, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/inspect.py", line 3054, in from_callable
return _signature_from_callable(obj, sigcls=cls,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scotts/miniforge3/envs/bkrsim/lib/python3.12/inspect.py", line 2530, in _signature_from_callable
raise TypeError(
TypeError: unexpected object <pydantic._internal._utils.ClassAttribute object at 0x7c78bdca8b50> in __signature__ attribute
Thanks for the great bug report. Super easy for me to dig into 👍
Minimal repro of the bug:
frompydanticimportBaseModelfromhydra_zenimportinstantiate, store, buildsfromhydra_zen.third_party.pydanticimportpydantic_parserclassInput(BaseModel):
x: int=1instantiate(builds(Input, x=1), _target_wrapper_=pydantic_parser)
# raises same error as OP
(Ironic that pydantic's validator can't handle its own types :P)
I'm very new to hydra and hydra-zen, so this could very much be a user issue, but I am experiencing the following.
Code Snippet
Expected Behavior
print the instantiated Input model.
Observed Behavior
Full Error Trace
config.yaml
hydra.yaml
Environment
Conda Environment
System Information
The text was updated successfully, but these errors were encountered: