File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -948,11 +948,14 @@ def _fill_constructor_arguments_with_fields(
948948 f for f in dataclasses .fields (dc_wrapper .dataclass ) if not f .init
949949 ]:
950950 field_dest = dc_wrapper .dest + "." + non_init_field .name
951- # We fetch the constructor arguments for the containing dataclass and check that it
951+ # Fetch the constructor arguments for the containing dataclass and check that it
952952 # doesn't have a value set.
953- dc_constructor_args = constructor_arguments
954- for dest_part in dc_wrapper .dest .split ("." ):
955- dc_constructor_args = dc_constructor_args [dest_part ]
953+ # NOTE: The `constructor_arguments` dict is FLAT here, so each dataclass has its
954+ # own corresponding arguments at their destination, like `"a.b": {}`.
955+ dc_constructor_args = constructor_arguments [dc_wrapper .dest ]
956+
957+ # for dest_part in dc_wrapper.dest.split("."):
958+ # dc_constructor_args = dc_constructor_args[dest_part]
956959 if non_init_field .name in dc_constructor_args :
957960 logger .warning (
958961 f"Field { field_dest } is a field with init=False, but a value is "
You can’t perform that action at this time.
0 commit comments