refactor: flip spine to NemoClient + swap all SDK imports - #1482
Closed
maxdubrinsky wants to merge 1 commit into
Closed
refactor: flip spine to NemoClient + swap all SDK imports#1482maxdubrinsky wants to merge 1 commit into
maxdubrinsky wants to merge 1 commit into
Conversation
Flip sdk_factory to return NemoClient/AsyncNemoClient instead of NeMoPlatform/AsyncNeMoPlatform. Rewrite the bridge adapter to use from_client() instead of reading Stainless private attrs. Swap all 528 consumer files from 'from nemo_platform' imports to typed client imports (nemo_platform_plugin.client.client, .errors, .types, etc.). Type annotations changed: NeMoPlatform -> NemoClient, AsyncNeMoPlatform -> AsyncNemoClient throughout. Method calls use new typed client method names (get_workspace, create_guardrail_config, etc.) which are available on the typed clients from PR 1. Old method names (retrieve, create, list, etc.) are also available via the compat layer from PR 2. The Stainless SDK remains in place (deletion is PR 10). 24 files that still import from nemo_platform (enhanced NeMoPlatform client, error handlers, code generators) are left as-is since the SDK is still present and importable. Pyproject.toml files are NOT changed (SDK deps kept) — removal happens in PR 10 when the SDK is actually deleted. AIRCORE-827 Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
Contributor
15 tasks
Contributor
Author
|
Closing in favor of area-by-area consumer migration approach (migrate consumers first via client_from_platform, flip spine last). The compat layer and big-bang spine flip are unnecessary. |
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.
Summary
Flip
sdk_factoryto returnNemoClient/AsyncNemoClientinstead ofNeMoPlatform/AsyncNeMoPlatform. Rewrite the bridge adapter to usefrom_client()instead of reading Stainless private attrs. Swap all 528 consumer files fromfrom nemo_platformimports to typed client imports. Type annotations changed throughout (NeMoPlatform->NemoClient,AsyncNeMoPlatform->AsyncNemoClient).Method calls use new typed client method names (
get_workspace,create_guardrail_config, etc.) from PR 1. Old method names are also available via the compat layer from PR 2.Related Issue
AIRCORE-827
Changes
sdk_factory.py: Spine flip — returnsNemoClient/AsyncNemoClient,PlatformClientTTypeVar bound to typed clients, URL resolver adaptedadapter.py: Rewritten to useClientCls.from_client(platform)instead of reading Stainless private attrs (_custom_headers,_client,_prepare_url, etc.)from nemo_platform-> typed client modules), type annotation changes, method name renames (old SDK names -> new typed client names)nemo_platform(enhanced NeMoPlatform client, error handlers, code generators, pagination types). The SDK is still present, so these imports work. Full migration happens when the code generators are updated and the SDK is deleted (PR 10).Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
py_compileon all 528 modified .py files: all compile (syntax OK)from nemo_platformimports are expected (SDK still present)Stack
PR 3 of the Stainless purge stack:
Note: The original plan had PRs 4-8 (per-area method renames) branching from PR 3. Since the exploration's files already include method renames alongside import swaps, those are folded into PR 3. The plan simplifies from 10 PRs to 5.