Fix: Client Services Scheduler to handle 404#224
Merged
1yam merged 3 commits intomainaleph-im/aleph-sdk-python:mainfrom Aug 12, 2025
1yam-fix-scheduler-service-get_allocationsaleph-im/aleph-sdk-python:1yam-fix-scheduler-service-get_allocationsCopy head branch name to clipboard
Merged
Fix: Client Services Scheduler to handle 404#2241yam merged 3 commits intomainaleph-im/aleph-sdk-python:mainfrom 1yam-fix-scheduler-service-get_allocationsaleph-im/aleph-sdk-python:1yam-fix-scheduler-service-get_allocationsCopy head branch name to clipboard
1yam merged 3 commits intomainaleph-im/aleph-sdk-python:mainfrom
1yam-fix-scheduler-service-get_allocationsaleph-im/aleph-sdk-python:1yam-fix-scheduler-service-get_allocationsCopy head branch name to clipboard
Conversation
|
Failed to retrieve llama text: POST 503: 503 Service UnavailableNo server is available to handle this request. |
nesitor
approved these changes
Aug 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to handle the case where scheduler send 404 when trying to get allocations of unallocated / wrong instance
Related ClickUp, GitHub or Jira tickets : ALEPH-597
Self proofreading checklist
Changes
This pull request introduces changes to improve error handling and data type flexibility in the
schedulerservice and related models. The key updates include handling404errors gracefully when fetching allocation information and updating type annotations to allowNonevalues for allocation-related fields.Error handling improvements:
src/aleph/sdk/client/services/scheduler.py: Updated theget_allocationmethod to handle404errors by returningNonewhen allocation information cannot be found on the scheduler. IntroducedClientResponseErrorfor error handling.Data type flexibility:
src/aleph/sdk/types.py: Modified theallocationsfield in theInstanceWithSchedulermodel to beOptional[AllocationItem], allowing it to represent cases where allocation information is unavailable.Typing updates:
src/aleph/sdk/client/services/scheduler.py: AddedOptionalto type imports to support the updated type annotations.