Refactor materialization operations to use MaterializeOp model#92
Merged
Refactor materialization operations to use MaterializeOp model#92
Conversation
This commit updates the materialization operations in the `graph_operations` module to utilize a new `MaterializeOp` model for request bodies. The changes streamline the API by consolidating parameters into a single object, enhancing clarity and maintainability. Key Changes: - Replaced individual parameters in `_get_kwargs`, `sync_detailed`, `sync`, and `asyncio_detailed` functions with a `body` parameter of type `MaterializeOp`. - Updated the `GraphClient` to construct the `MaterializeOp` object from options before invoking the materialization operation. These modifications improve the structure of the API and align with the recent refactoring efforts to unify graph operations.
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
Refactors the materialization operation logic to use a dedicated
MaterializeOpmodel, replacing inline/ad-hoc parameter handling with a structured, typed approach. This aligns materialization operations with the existing pattern used by other graph operations (e.g.,UpgradeTierOp).Key Accomplishments
MaterializeOpmodel: Introduced a dedicated Pydantic/data model (materialize_op.py) that encapsulates all parameters and validation logic for materialization operations, improving type safety and maintainability.UpgradeTierOpNewTiermodel: Added a supporting model for the upgrade tier operation's new tier representation, further strengthening the type system across graph operations.DatabaseHealthResponsemodel: Added a structured model for database health responses (93 lines of new model code), replacing loosely-typed response handling.op_materialize.py: Reduced the materialization operation module by ~100 lines by delegating parameter construction and validation to the newMaterializeOpmodel, significantly improving readability and reducing duplication.graph_client.py: Adjusted the graph client to work with the new model-based approach for materialization calls.models/__init__.pyto expose the new models as part of the public API.Breaking Changes
MaterializeOpmodel. The method signatures in the graph client have been updated accordingly.robosystems_client.models; any code importing directly from internal modules may need path updates.Testing Notes
test_materialization_client.py) have been updated to reflect the new model-based interface.MaterializeOpmodel.DatabaseHealthResponsemodel correctly deserializes health check responses from the API.Infrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
refactor/additional-graph-opsmainCo-Authored-By: Claude noreply@anthropic.com