@@ -702,12 +702,12 @@ def interface_to_python_class(
702702 # types via generics, each in array or object configurations.
703703 # Typing this attribute proved very difficult. A solution
704704 # that worked with mypy and pyright is to type "buckets"
705- # with the array ( list) form, and create a `buckets_as_dict`
706- # property that is typed appropriate for accessing the
707- # buckets when in object ( dictionary) form.
705+ # for the list form, and create a `buckets_as_dict`
706+ # property that is typed appropriately for accessing the
707+ # buckets in dictionary form.
708708 # The generic type is assumed to be the first in the list,
709- # which is a simplification that should be removed when a
710- # more complete implementation of generic is added.
709+ # which is a simplification that should be improved when a
710+ # more complete implementation of generics is added.
711711 if generics [0 ]["type" ]["name" ] == "Void" :
712712 generic_type = "Any"
713713 else :
@@ -733,6 +733,11 @@ def interface_to_python_class(
733733 )
734734 k ["buckets_as_dict" ] = generic_type
735735 else :
736+ if interface == "Hit" and arg ["name" ].startswith ("_" ):
737+ # Python DSL removes the undersore prefix from all the
738+ # properties of the hit, so we do the same
739+ arg ["name" ] = arg ["name" ][1 :]
740+
736741 self .add_attribute (
737742 k , arg , for_types_py = for_types_py , for_response = for_response
738743 )
0 commit comments