66
77
88def is_step_data_with_name_and_measurement (data : Dict [str , Any ]) -> bool :
9- """Checks if a measurement is required by ensuring it has both 'name' and 'measurement' fields.
9+ """Checks if a step data parameter is a measurement data by ensuring it
10+ has both 'name' and 'measurement' fields.
1011
1112 Args:
1213 measurement: A dictionary containing measurement data.
@@ -62,7 +63,7 @@ def convert_steps_to_dataframe(
6263 Args:
6364 steps: A list of steps.
6465 is_measurement_data_parameter: Optional callback function that checks if a step data parameter is a
65- required measurement so that only those are included in the resultant dataframe. The method takes
66+ measurement so that only those are included in the returned dataframe. The method takes
6667 a dictionary as input and returns a boolean value.
6768 The default behavior is to consider only parameters that have both 'name' and 'measurement'
6869 fields as measurement parameters.
@@ -324,21 +325,20 @@ def __group_step_columns(dataframe_columns: List[str]) -> List[str]:
324325 GENERAL_CATEGORIES = "general"
325326 CATEGORY_KEYS = [
326327 GENERAL_CATEGORIES ,
327- StepProjection .INPUTS ,
328- StepProjection .OUTPUTS ,
329- StepProjection .DATA ,
330- StepProjection .PROPERTIES ,
328+ StepProjection .INPUTS . lower () ,
329+ StepProjection .OUTPUTS . lower () ,
330+ StepProjection .DATA . lower () ,
331+ StepProjection .PROPERTIES . lower () ,
331332 ]
332- category_keys_lower = [category .lower () for category in CATEGORY_KEYS ]
333333 grouped_columns : Dict [str , List [str ]] = {
334- category : [] for category in category_keys_lower
334+ category : [] for category in CATEGORY_KEYS
335335 }
336336 for column in dataframe_columns :
337337 column_lower = column .lower ()
338338 key = next (
339339 (
340340 category
341- for category in category_keys_lower [1 :]
341+ for category in CATEGORY_KEYS [1 :]
342342 if column_lower .startswith (category )
343343 and column != StepProjection .DATA_MODEL .lower ()
344344 ),
@@ -347,6 +347,6 @@ def __group_step_columns(dataframe_columns: List[str]) -> List[str]:
347347 grouped_columns [key ].append (column )
348348 return [
349349 column
350- for category_key in category_keys_lower
350+ for category_key in CATEGORY_KEYS
351351 for column in grouped_columns [category_key ]
352352 ]
0 commit comments