@@ -90,7 +90,7 @@ def _query_params_from_event_reference(
90
90
) -> str :
91
91
event_type_name = temporalio .api .enums .v1 .EventType .Name (event_ref .event_type )
92
92
if event_type_name .startswith ("EVENT_TYPE_" ):
93
- event_type_name = _constant_case_to_pascal_case (
93
+ event_type_name = _event_type_constant_case_to_pascal_case (
94
94
event_type_name .removeprefix ("EVENT_TYPE_" )
95
95
)
96
96
return urllib .parse .urlencode (
@@ -116,7 +116,7 @@ def _event_reference_from_query_params(
116
116
if raw_event_type_name .startswith ("EVENT_TYPE_" ):
117
117
event_type_name = raw_event_type_name
118
118
elif re .match ("[A-Z][a-z]" , raw_event_type_name ):
119
- event_type_name = "EVENT_TYPE_" + _pascal_case_to_constant_case (
119
+ event_type_name = "EVENT_TYPE_" + _event_type_pascal_case_to_constant_case (
120
120
raw_event_type_name
121
121
)
122
122
else :
@@ -137,19 +137,19 @@ def _event_reference_from_query_params(
137
137
)
138
138
139
139
140
- def _constant_case_to_pascal_case (s : str ) -> str :
140
+ def _event_type_constant_case_to_pascal_case (s : str ) -> str :
141
141
"""Convert a CONSTANT_CASE string to PascalCase.
142
142
143
- >>> _constant_case_to_pascal_case ("NEXUS_OPERATION_SCHEDULED")
143
+ >>> _event_type_constant_case_to_pascal_case ("NEXUS_OPERATION_SCHEDULED")
144
144
"NexusOperationScheduled"
145
145
"""
146
146
return re .sub (r"(\b|_)([a-z])" , lambda m : m .groups ()[1 ].upper (), s .lower ())
147
147
148
148
149
- def _pascal_case_to_constant_case (s : str ) -> str :
149
+ def _event_type_pascal_case_to_constant_case (s : str ) -> str :
150
150
"""Convert a PascalCase string to CONSTANT_CASE.
151
151
152
- >>> _pascal_case_to_constant_case ("NexusOperationScheduled")
152
+ >>> _event_type_pascal_case_to_constant_case ("NexusOperationScheduled")
153
153
"NEXUS_OPERATION_SCHEDULED"
154
154
"""
155
155
return re .sub (r"([^\b])([A-Z])" , lambda m : "_" .join (m .groups ()), s ).upper ()
0 commit comments