Exception Raised on Fetching Schedule Using ml_client.schedules.get(SCHEDULE_NAME) #37466
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Machine Learning
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Describe the bug
When attempting to retrieve a schedule using the function ml_client.schedules.get(SCHEDULE_NAME), an exception is raised: ScheduleException: Job definition for schedule SCHEDULE_NAME can not be None. This issue seems to originate from a sanity check in the get function at line 231 in azure\ai\ml\operations_schedule_operations.py.
Additionally, there is confusion as to why there can be a schedule in Azure Machine Learning services without an associated job definition. This inconsistency needs to be addressed.
To Reproduce
Steps to reproduce the behavior:
from azure.ai.ml import MLClient
ml_client = MLClient(subscription_id, resource_group, workspace_name)
schedule = ml_client.schedules.get(SCHEDULE_NAME
Expected behavior
The ml_client.schedules.get(SCHEDULE_NAME) function should return the details of the specified schedule instead of raising an exception. The schedule exists, so it should have an associated job definition, or the system should handle cases where the job definition is missing more gracefully.
Screenshots
Exception: ScheduleException: Job definition for schedule SCHEDULE_NAME can not be None.
Stack:
...
schedule = ml_client.schedules.get(SCHEDULE_NAME)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\core\tracing\decorator.py", line 94, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\ai\ml_telemetry\activity.py", line 372, in wrapper
return_value = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\ai\ml\operations_schedule_operations.py", line 227, in get
return self.service_client.get(
^^^^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\core\tracing\decorator.py", line 94, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\ai\ml_restclient\v2023_06_01_preview\operations_schedules_operations.py", line 498, in get
return cls(pipeline_response, deserialized, {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\ai\ml\operations_schedule_operations.py", line 231, in
cls=lambda _, obj, __: Schedule._from_rest_object(obj),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\ai\ml\entities_schedule\schedule.py", line 171, in _from_rest_object
return JobSchedule._from_rest_object(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\venv\Lib\site-packages\azure\ai\ml\entities_schedule\schedule.py", line 385, in _from_rest_object
raise ScheduleException(
.
The text was updated successfully, but these errors were encountered: