@@ -312,6 +312,7 @@ def _add_signature_parameter(
312312 kwargs ['required' ] = True
313313 is_subclass_typehint = False
314314 is_final_class_typehint = is_final_class (annotation )
315+ is_pure_dataclass_typehint = is_pure_dataclass (annotation )
315316 dest = (nested_key + '.' if nested_key else '' ) + name
316317 args = [dest if is_required and as_positional else '--' + dest ]
317318 if param .origin :
@@ -326,7 +327,7 @@ def _add_signature_parameter(
326327 if annotation in {str , int , float , bool } or \
327328 is_subclass (annotation , (str , int , float )) or \
328329 is_final_class_typehint or \
329- is_pure_dataclass ( annotation ) :
330+ is_pure_dataclass_typehint :
330331 kwargs ['type' ] = annotation
331332 elif annotation != inspect_empty :
332333 try :
@@ -353,7 +354,7 @@ def _add_signature_parameter(
353354 'sub_configs' : sub_configs ,
354355 'instantiate' : instantiate ,
355356 }
356- if is_final_class_typehint :
357+ if is_final_class_typehint or is_pure_dataclass_typehint :
357358 kwargs .update (sub_add_kwargs )
358359 action = group .add_argument (* args , ** kwargs )
359360 action .sub_add_kwargs = sub_add_kwargs
@@ -370,6 +371,7 @@ def add_dataclass_arguments(
370371 nested_key : str ,
371372 default : Optional [Union [Type , dict ]] = None ,
372373 as_group : bool = True ,
374+ fail_untyped : bool = True ,
373375 ** kwargs
374376 ) -> List [str ]:
375377 """Adds arguments from a dataclass based on its field types and docstrings.
@@ -379,6 +381,7 @@ def add_dataclass_arguments(
379381 nested_key: Key for nested namespace.
380382 default: Value for defaults. Must be instance of or kwargs for theclass.
381383 as_group: Whether arguments should be added to a new argument group.
384+ fail_untyped: Whether to raise exception if a required parameter does not have a type.
382385
383386 Returns:
384387 The list of arguments added.
@@ -413,6 +416,7 @@ def add_dataclass_arguments(
413416 nested_key ,
414417 params [field .name ],
415418 added_args ,
419+ fail_untyped = fail_untyped ,
416420 default = defaults .get (field .name , inspect_empty ),
417421 )
418422
0 commit comments