SIENTIAPDE-1243: Add type ignores and fix datetime index formatting in gates and model repository.
This commit is contained in:
@@ -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',
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user