aws/sagemaker-python-sdk

_update_data_quality_monitoring_schedule fails when schedule_cron_expression=NOW

luke-gerschwitz opened this issue · 0 comments

Describe the bug
When updating a data quality monitoring schedule with a schedule_cron_expression set to 'NOW' a ValueError occurs from _check_monitoring_schedule_cron_validity method. This is caused in Line 2146 of model_monitoring.py in DefaultModelMonitor._update_data_quality_monitoring_schedule as parameters data_analysis_start_time and data_analysis_end_time are not provided to ModelMonitor._update_monitoring_schedule.

To reproduce
Update a data quality monitoring schedule that has a schedule_cron_expression set to 'NOW'.

Expected behavior
data_analysis_start_time and data_analysis_end_time should be provided as parameters to ModelMonitor._update_monitoring_schedule thus ensuring _check_monitoring_schedule_cron_validity runs correctly.

I suggest the following change to Line 2146 in model_monitoring.py

From:

self._update_monitoring_schedule(new_job_definition_name, schedule_cron_expression, )

To:

self._update_monitoring_schedule( job_definition_name=new_job_definition_name, schedule_cron_expression=schedule_cron_expression, data_analysis_start_time=data_analysis_start_time, data_analysis_end_time=data_analysis_end_time )

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version:
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans):
  • Framework version:
  • Python version:
  • CPU or GPU:
  • Custom Docker image (Y/N):

Additional context
Add any other context about the problem here.