Skip to content

fix(core): restore the Session hub methods used by the JumpStart Hub class - #6429

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/jumpstart-hub-session-methods
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/jumpstart-hub-session-methods

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: N/A

Description of changes:

sagemaker.core.jumpstart.hub.hub.Hub calls these methods on its Session:

  • create_hub
  • describe_hub
  • delete_hub
  • create_hub_content_reference
  • delete_hub_content_reference

Only list_hub_contents and describe_hub_content were ported to the v3 Session. So Hub.create(), describe(), delete(), create_model_reference() and delete_model_reference() all fail:

AttributeError: 'Session' object has no attribute 'create_hub'

This change:

  • ports those five thin wrappers from the v2 Session, with the same request building. For example, HubDisplayName defaults to the hub name;
  • sets Hub.region after the fallback to the default JumpStart session. Previously it read sagemaker_session.boto_region_name first, so Hub(name, sagemaker_session=None) failed with 'NoneType' object has no attribute 'boto_region_name'.

Testing:

  • New test_hub.py tests drive each Hub method through a real Session with a mocked sagemaker_client and check the API request.
  • A test covers Hub(..., sagemaker_session=None).
  • All six fail before this change.
  • tests/unit/jumpstart: 349 passed.
  • Full sagemaker-core/tests/unit: no new failures. The one failure, test_generate_compose_file_sets_timeout_env, also fails on master when run on its own.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…class

sagemaker.core.jumpstart.hub.hub.Hub calls create_hub, describe_hub,
delete_hub, create_hub_content_reference and delete_hub_content_reference
on its Session, but only list_hub_contents/describe_hub_content were ported
to the v3 Session. Hub.create(), describe(), delete(),
create_model_reference() and delete_model_reference() therefore all failed
with AttributeError: 'Session' object has no attribute ...

Port those five thin wrappers from the v2 Session. Also resolve Hub.region
after falling back to the default JumpStart session, so
Hub(name, sagemaker_session=None) no longer fails on
None.boto_region_name.

This branch is waiting to be deployed

1 waiting deployment
manual-approval — 54316c93 Waiting Oct 10, 2026 by AkshayShah03 via wait-for-approval #611
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant