@@ -44,10 +44,11 @@ class BatchPredictionVersion(AbstractApiClass):
44
44
outputFeatureGroupId (str): The BP output feature group id if applicable
45
45
outputFeatureGroupVersion (str): The BP output feature group version if applicable
46
46
outputFeatureGroupTableName (str): The BP output feature group name if applicable
47
+ batchPredictionWarnings (str): Relevant warnings if any issues are found
47
48
batchInputs (PredictionInput): Inputs to the batch prediction
48
49
"""
49
50
50
- def __init__ (self , client , batchPredictionVersion = None , batchPredictionId = None , status = None , driftMonitorStatus = None , deploymentId = None , modelId = None , modelVersion = None , predictionsStartedAt = None , predictionsCompletedAt = None , databaseOutputError = None , totalPredictions = None , failedPredictions = None , databaseConnectorId = None , databaseOutputConfiguration = None , explanations = None , fileConnectorOutputLocation = None , fileOutputFormat = None , connectorType = None , legacyInputLocation = None , error = None , driftMonitorError = None , monitorWarnings = None , csvInputPrefix = None , csvPredictionPrefix = None , csvExplanationsPrefix = None , databaseOutputTotalWrites = None , databaseOutputFailedWrites = None , outputIncludesMetadata = None , resultInputColumns = None , modelMonitorVersion = None , algoName = None , algorithm = None , outputFeatureGroupId = None , outputFeatureGroupVersion = None , outputFeatureGroupTableName = None , batchInputs = {}, globalPredictionArgs = {}):
51
+ def __init__ (self , client , batchPredictionVersion = None , batchPredictionId = None , status = None , driftMonitorStatus = None , deploymentId = None , modelId = None , modelVersion = None , predictionsStartedAt = None , predictionsCompletedAt = None , databaseOutputError = None , totalPredictions = None , failedPredictions = None , databaseConnectorId = None , databaseOutputConfiguration = None , explanations = None , fileConnectorOutputLocation = None , fileOutputFormat = None , connectorType = None , legacyInputLocation = None , error = None , driftMonitorError = None , monitorWarnings = None , csvInputPrefix = None , csvPredictionPrefix = None , csvExplanationsPrefix = None , databaseOutputTotalWrites = None , databaseOutputFailedWrites = None , outputIncludesMetadata = None , resultInputColumns = None , modelMonitorVersion = None , algoName = None , algorithm = None , outputFeatureGroupId = None , outputFeatureGroupVersion = None , outputFeatureGroupTableName = None , batchPredictionWarnings = None , batchInputs = {}, globalPredictionArgs = {}):
51
52
super ().__init__ (client , batchPredictionVersion )
52
53
self .batch_prediction_version = batchPredictionVersion
53
54
self .batch_prediction_id = batchPredictionId
@@ -84,13 +85,14 @@ def __init__(self, client, batchPredictionVersion=None, batchPredictionId=None,
84
85
self .output_feature_group_id = outputFeatureGroupId
85
86
self .output_feature_group_version = outputFeatureGroupVersion
86
87
self .output_feature_group_table_name = outputFeatureGroupTableName
88
+ self .batch_prediction_warnings = batchPredictionWarnings
87
89
self .batch_inputs = client ._build_class (PredictionInput , batchInputs )
88
90
self .global_prediction_args = client ._build_class (
89
91
BatchPredictionArgs , globalPredictionArgs )
90
92
91
93
def __repr__ (self ):
92
- repr_dict = {f'batch_prediction_version' : repr (self .batch_prediction_version ), f'batch_prediction_id' : repr (self .batch_prediction_id ), f'status' : repr (self .status ), f'drift_monitor_status' : repr (self .drift_monitor_status ), f'deployment_id' : repr (self .deployment_id ), f'model_id' : repr (self .model_id ), f'model_version' : repr (self .model_version ), f'predictions_started_at' : repr (self .predictions_started_at ), f'predictions_completed_at' : repr (self .predictions_completed_at ), f'database_output_error' : repr (self .database_output_error ), f'total_predictions' : repr (self .total_predictions ), f'failed_predictions' : repr (self .failed_predictions ), f'database_connector_id' : repr (self .database_connector_id ), f'database_output_configuration' : repr (self .database_output_configuration ), f'explanations' : repr (self .explanations ), f'file_connector_output_location' : repr (self .file_connector_output_location ), f'file_output_format' : repr (self .file_output_format ), f'connector_type' : repr (self .connector_type ), f'legacy_input_location' : repr (
93
- self .legacy_input_location ), f'error' : repr (self .error ), f'drift_monitor_error' : repr (self .drift_monitor_error ), f'monitor_warnings' : repr (self .monitor_warnings ), f'csv_input_prefix' : repr (self .csv_input_prefix ), f'csv_prediction_prefix' : repr (self .csv_prediction_prefix ), f'csv_explanations_prefix' : repr (self .csv_explanations_prefix ), f'database_output_total_writes' : repr (self .database_output_total_writes ), f'database_output_failed_writes' : repr (self .database_output_failed_writes ), f'output_includes_metadata' : repr (self .output_includes_metadata ), f'result_input_columns' : repr (self .result_input_columns ), f'model_monitor_version' : repr (self .model_monitor_version ), f'algo_name' : repr (self .algo_name ), f'algorithm' : repr (self .algorithm ), f'output_feature_group_id' : repr (self .output_feature_group_id ), f'output_feature_group_version' : repr (self .output_feature_group_version ), f'output_feature_group_table_name' : repr (self .output_feature_group_table_name ), f'batch_inputs' : repr (self .batch_inputs ), f'global_prediction_args' : repr (self .global_prediction_args )}
94
+ repr_dict = {f'batch_prediction_version' : repr (self .batch_prediction_version ), f'batch_prediction_id' : repr (self .batch_prediction_id ), f'status' : repr (self .status ), f'drift_monitor_status' : repr (self .drift_monitor_status ), f'deployment_id' : repr (self .deployment_id ), f'model_id' : repr (self .model_id ), f'model_version' : repr (self .model_version ), f'predictions_started_at' : repr (self .predictions_started_at ), f'predictions_completed_at' : repr (self .predictions_completed_at ), f'database_output_error' : repr (self .database_output_error ), f'total_predictions' : repr (self .total_predictions ), f'failed_predictions' : repr (self .failed_predictions ), f'database_connector_id' : repr (self .database_connector_id ), f'database_output_configuration' : repr (self .database_output_configuration ), f'explanations' : repr (self .explanations ), f'file_connector_output_location' : repr (self .file_connector_output_location ), f'file_output_format' : repr (self .file_output_format ), f'connector_type' : repr (self .connector_type ), f'legacy_input_location' : repr (self .legacy_input_location ), f'error' : repr (
95
+ self .error ), f'drift_monitor_error' : repr (self .drift_monitor_error ), f'monitor_warnings' : repr (self .monitor_warnings ), f'csv_input_prefix' : repr (self .csv_input_prefix ), f'csv_prediction_prefix' : repr (self .csv_prediction_prefix ), f'csv_explanations_prefix' : repr (self .csv_explanations_prefix ), f'database_output_total_writes' : repr (self .database_output_total_writes ), f'database_output_failed_writes' : repr (self .database_output_failed_writes ), f'output_includes_metadata' : repr (self .output_includes_metadata ), f'result_input_columns' : repr (self .result_input_columns ), f'model_monitor_version' : repr (self .model_monitor_version ), f'algo_name' : repr (self .algo_name ), f'algorithm' : repr (self .algorithm ), f'output_feature_group_id' : repr (self .output_feature_group_id ), f'output_feature_group_version' : repr (self .output_feature_group_version ), f'output_feature_group_table_name' : repr (self .output_feature_group_table_name ), f'batch_prediction_warnings' : repr (self .batch_prediction_warnings ), f'batch_inputs' : repr (self .batch_inputs ), f'global_prediction_args' : repr (self .global_prediction_args )}
94
96
class_name = "BatchPredictionVersion"
95
97
repr_str = ',\n ' .join ([f'{ key } ={ value } ' for key , value in repr_dict .items (
96
98
) if getattr (self , key , None ) is not None ])
@@ -103,8 +105,8 @@ def to_dict(self):
103
105
Returns:
104
106
dict: The dict value representation of the class parameters
105
107
"""
106
- resp = {'batch_prediction_version' : self .batch_prediction_version , 'batch_prediction_id' : self .batch_prediction_id , 'status' : self .status , 'drift_monitor_status' : self .drift_monitor_status , 'deployment_id' : self .deployment_id , 'model_id' : self .model_id , 'model_version' : self .model_version , 'predictions_started_at' : self .predictions_started_at , 'predictions_completed_at' : self .predictions_completed_at , 'database_output_error' : self .database_output_error , 'total_predictions' : self .total_predictions , 'failed_predictions' : self .failed_predictions , 'database_connector_id' : self .database_connector_id , 'database_output_configuration' : self .database_output_configuration , 'explanations' : self .explanations , 'file_connector_output_location' : self .file_connector_output_location , 'file_output_format' : self .file_output_format , 'connector_type' : self .connector_type , 'legacy_input_location' : self .legacy_input_location , 'error' : self .error ,
107
- 'drift_monitor_error' : self . drift_monitor_error , ' monitor_warnings' : self .monitor_warnings , 'csv_input_prefix' : self .csv_input_prefix , 'csv_prediction_prefix' : self .csv_prediction_prefix , 'csv_explanations_prefix' : self .csv_explanations_prefix , 'database_output_total_writes' : self .database_output_total_writes , 'database_output_failed_writes' : self .database_output_failed_writes , 'output_includes_metadata' : self .output_includes_metadata , 'result_input_columns' : self .result_input_columns , 'model_monitor_version' : self .model_monitor_version , 'algo_name' : self .algo_name , 'algorithm' : self .algorithm , 'output_feature_group_id' : self .output_feature_group_id , 'output_feature_group_version' : self .output_feature_group_version , 'output_feature_group_table_name' : self .output_feature_group_table_name , 'batch_inputs' : self ._get_attribute_as_dict (self .batch_inputs ), 'global_prediction_args' : self ._get_attribute_as_dict (self .global_prediction_args )}
108
+ resp = {'batch_prediction_version' : self .batch_prediction_version , 'batch_prediction_id' : self .batch_prediction_id , 'status' : self .status , 'drift_monitor_status' : self .drift_monitor_status , 'deployment_id' : self .deployment_id , 'model_id' : self .model_id , 'model_version' : self .model_version , 'predictions_started_at' : self .predictions_started_at , 'predictions_completed_at' : self .predictions_completed_at , 'database_output_error' : self .database_output_error , 'total_predictions' : self .total_predictions , 'failed_predictions' : self .failed_predictions , 'database_connector_id' : self .database_connector_id , 'database_output_configuration' : self .database_output_configuration , 'explanations' : self .explanations , 'file_connector_output_location' : self .file_connector_output_location , 'file_output_format' : self .file_output_format , 'connector_type' : self .connector_type , 'legacy_input_location' : self .legacy_input_location , 'error' : self .error , 'drift_monitor_error' : self . drift_monitor_error ,
109
+ 'monitor_warnings' : self .monitor_warnings , 'csv_input_prefix' : self .csv_input_prefix , 'csv_prediction_prefix' : self .csv_prediction_prefix , 'csv_explanations_prefix' : self .csv_explanations_prefix , 'database_output_total_writes' : self .database_output_total_writes , 'database_output_failed_writes' : self .database_output_failed_writes , 'output_includes_metadata' : self .output_includes_metadata , 'result_input_columns' : self .result_input_columns , 'model_monitor_version' : self .model_monitor_version , 'algo_name' : self .algo_name , 'algorithm' : self .algorithm , 'output_feature_group_id' : self .output_feature_group_id , 'output_feature_group_version' : self .output_feature_group_version , 'output_feature_group_table_name' : self .output_feature_group_table_name , 'batch_prediction_warnings' : self . batch_prediction_warnings , 'batch_inputs' : self ._get_attribute_as_dict (self .batch_inputs ), 'global_prediction_args' : self ._get_attribute_as_dict (self .global_prediction_args )}
108
110
return {key : value for key , value in resp .items () if value is not None }
109
111
110
112
def download_batch_prediction_result_chunk (self , offset : int = 0 , chunk_size : int = 10485760 ):
@@ -148,6 +150,18 @@ def describe(self):
148
150
"""
149
151
return self .client .describe_batch_prediction_version (self .batch_prediction_version )
150
152
153
+ def get_logs (self ):
154
+ """
155
+ Retrieves the batch prediction logs.
156
+
157
+ Args:
158
+ batch_prediction_version (str): The unique version ID of the batch prediction version.
159
+
160
+ Returns:
161
+ BatchPredictionVersionLogs: The logs for the specified batch prediction version.
162
+ """
163
+ return self .client .get_batch_prediction_version_logs (self .batch_prediction_version )
164
+
151
165
def download_result_to_file (self , file ):
152
166
"""
153
167
Downloads the batch prediction version in a local file.
0 commit comments