Skip to content

Refactor materialization operations to use MaterializeOp model#92

Merged
jfrench9 merged 1 commit intomainfrom
refactor/additional-graph-ops
Apr 16, 2026
Merged

Refactor materialization operations to use MaterializeOp model#92
jfrench9 merged 1 commit intomainfrom
refactor/additional-graph-ops

Conversation

@jfrench9
Copy link
Copy Markdown
Member

Summary

Refactors the materialization operation logic to use a dedicated MaterializeOp model, 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

  • New MaterializeOp model: Introduced a dedicated Pydantic/data model (materialize_op.py) that encapsulates all parameters and validation logic for materialization operations, improving type safety and maintainability.
  • New UpgradeTierOpNewTier model: Added a supporting model for the upgrade tier operation's new tier representation, further strengthening the type system across graph operations.
  • New DatabaseHealthResponse model: Added a structured model for database health responses (93 lines of new model code), replacing loosely-typed response handling.
  • Simplified op_materialize.py: Reduced the materialization operation module by ~100 lines by delegating parameter construction and validation to the new MaterializeOp model, significantly improving readability and reducing duplication.
  • Updated graph_client.py: Adjusted the graph client to work with the new model-based approach for materialization calls.
  • Exported new models: Updated models/__init__.py to expose the new models as part of the public API.

Breaking Changes

  • API surface change: Consumers that previously constructed materialization operation parameters inline will need to migrate to using the MaterializeOp model. The method signatures in the graph client have been updated accordingly.
  • Model imports: New models are now available via robosystems_client.models; any code importing directly from internal modules may need path updates.

Testing Notes

  • Existing materialization tests (test_materialization_client.py) have been updated to reflect the new model-based interface.
  • Verify that all materialization workflows (create, update, delete) function correctly end-to-end with the new MaterializeOp model.
  • Validate that the DatabaseHealthResponse model correctly deserializes health check responses from the API.

Infrastructure Considerations

  • No new dependencies introduced; the new models follow existing patterns and frameworks already in use.
  • Downstream services or CI pipelines that depend on the materialization client interface should be validated against the updated method signatures.
  • This is a stepping stone toward a consistent model-driven pattern for all graph operations, making future operation additions more straightforward.

🤖 Generated with Claude Code

Branch Info:

  • Source: refactor/additional-graph-ops
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

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.
@jfrench9 jfrench9 merged commit e92516d into main Apr 16, 2026
1 check passed
@jfrench9 jfrench9 deleted the refactor/additional-graph-ops branch April 16, 2026 07:59
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