Is your feature request related to a problem? Please describe.
As explained in #156 there are incompatibilities between dcutils of lmctl and Pydantic 1.1.0. The issue can be shown by installing Pydantic 1.10.x and running python3 -m unittest tests.unit.utils.dcutils.test_dc_capture.TestRecordAttrs.test_record_pydantic_dataclass from lmctl. The test will fail.
It seems like the __init__ function of Pydantic dataclasses has changed so the _wrap_init method of lmctl.utils.dcutils.dc_capture can no longer infer the arguments of the constructor. The below snippet from _wrap_init is the root of the problem. The value of expected_args is [] when it previously returned the argument specs in the constructor, in order of definition:
Describe the solution you'd like
For lmctl to work with Pydantic 1.10.x, ideally without losing the functionality of dcutils. Alternatively, we'll have to replace usage of dcutils, which is used to guide the attributes to be included when deserializing a dataclass into YAML/JSON. This is particularly useful when rewriting the lmctl config file as it avoids writing attributes that have defaults but were never set by the user.
Is your feature request related to a problem? Please describe. As explained in #156 there are incompatibilities between
dcutils
of lmctl and Pydantic 1.1.0. The issue can be shown by installing Pydantic 1.10.x and runningpython3 -m unittest tests.unit.utils.dcutils.test_dc_capture.TestRecordAttrs.test_record_pydantic_dataclass
from lmctl. The test will fail.It seems like the
__init__
function of Pydantic dataclasses has changed so the_wrap_init
method oflmctl.utils.dcutils.dc_capture
can no longer infer the arguments of the constructor. The below snippet from_wrap_init
is the root of the problem. The value ofexpected_args
is[]
when it previously returned the argument specs in the constructor, in order of definition:Describe the solution you'd like For lmctl to work with Pydantic 1.10.x, ideally without losing the functionality of
dcutils
. Alternatively, we'll have to replace usage ofdcutils
, which is used to guide the attributes to be included when deserializing a dataclass into YAML/JSON. This is particularly useful when rewriting the lmctl config file as it avoids writing attributes that have defaults but were never set by the user.