diff --git a/model_manager/activities/gates.py b/model_manager/activities/gates.py index 091977c..897d57d 100644 --- a/model_manager/activities/gates.py +++ b/model_manager/activities/gates.py @@ -126,9 +126,9 @@ class Gates(BaseActivity): self.error(f'Filter {fil} not found', metadata) continue try: - if input_filter_functions[fil](data, config['config']): + if input_filter_functions[fil](data, config['config']): # type: ignore[operator] self.debug(f'Data not passed the input filter {fil}:{config}', metadata) - filter_output.append(config['policy']) + filter_output.append(config['policy']) # type: ignore[index] except Exception as e: # noqa: BLE001 trace = traceback.format_exc() self.send_notification( @@ -145,7 +145,7 @@ class Gates(BaseActivity): self.info(f'Input gate result: {path_flag}', metadata) return ( path_flag, - input_filter_functions['path_confidence'][path_flag], + input_filter_functions['path_confidence'][path_flag], # type: ignore[index] 'Input data with bad quality', ) @@ -205,8 +205,8 @@ class Gates(BaseActivity): self.error(f'Filter {fil} not found', metadata) continue try: - if mlflow_response_filter_functions[fil](data, config): - filter_output.append(config['policy']) + if mlflow_response_filter_functions[fil](data, config): # type: ignore[operator] + filter_output.append(config['policy']) # type: ignore[index] comments.append(data['content']['message']) self.send_notification( metadata=metadata, @@ -232,7 +232,7 @@ class Gates(BaseActivity): self.info(f'Mlflow response gate result: {path_flag}', metadata) return ( path_flag, - mlflow_response_filter_functions['path_confidence'][path_flag], + mlflow_response_filter_functions['path_confidence'][path_flag], # type: ignore[index] ', '.join(comments), ) @@ -290,8 +290,8 @@ class Gates(BaseActivity): if fil not in mlflow_content_filter_functions: continue try: - if mlflow_content_filter_functions[fil](data, config): - filter_output.append(config['policy']) + if mlflow_content_filter_functions[fil](data, config): # type: ignore[operator] + filter_output.append(config['policy']) # type: ignore[index] self.send_notification( metadata=metadata, notification_id=f'{gate_type.upper()}_GATE_CONTENT_FILTER__{fil}', @@ -316,7 +316,7 @@ class Gates(BaseActivity): self.info(f'Mlflow content gate result: {path_flag}', metadata) return ( path_flag, - mlflow_content_filter_functions['path_confidence'][path_flag], + mlflow_content_filter_functions['path_confidence'][path_flag], # type: ignore[index] 'Transformed data not passed the content filter', ) diff --git a/model_manager/utils/repository/model_repository.py b/model_manager/utils/repository/model_repository.py index c52b3f3..5dafc76 100644 --- a/model_manager/utils/repository/model_repository.py +++ b/model_manager/utils/repository/model_repository.py @@ -58,7 +58,7 @@ class MLFlowRepository: raise ValueError(f'{message}') from e elif index_type == datetime or index_type == pd.Timestamp: - data.index = data.index.strftime(DATETIME_FORMAT_WITH_TZ) + data.index = data.index.strftime(DATETIME_FORMAT_WITH_TZ) # type: ignore[attr-defined] else: raise ValueError(f'{message}')