Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.63k stars 2.84k forks source link

Exception Raised on Fetching Schedule Using ml_client.schedules.get(SCHEDULE_NAME) #37466

Open t9i9m opened 2 months ago

t9i9m commented 2 months ago

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_scheduleoperations.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( .

github-actions[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.