Skip to content

Commit e10cd88

Browse files
jfrench9claude
andauthored
Refactor extensions architecture: replace TableIngestClient with specialized clients (#37)
## Summary This PR refactors the extensions module architecture by decomposing the monolithic `TableIngestClient` into three specialized, focused clients: `FileClient`, `MaterializationClient`, and `TableClient`. This change improves code organization, maintainability, and follows the single responsibility principle. ## Key Accomplishments - **Architectural improvement**: Split single large client (~463 lines) into three focused clients totaling ~750 lines with better separation of concerns - **New specialized clients**: - `FileClient`: Handles file operations and management - `MaterializationClient`: Manages data materialization processes - `TableClient`: Focuses on table-specific operations - **Updated module exports**: Modified `__init__.py` and `extensions.py` to expose the new client architecture - **Maintained functionality**: All existing capabilities preserved through the new client structure ## Breaking Changes ⚠️ **Breaking Changes Present** - `TableIngestClient` has been completely removed - Import statements referencing `TableIngestClient` will need to be updated to use the appropriate new client (`FileClient`, `MaterializationClient`, or `TableClient`) - Any code directly instantiating `TableIngestClient` will require refactoring ## Testing Notes - Updated existing extension tests to work with the new client architecture - Removed obsolete `TableIngestClient` tests (112 lines) - Added new test coverage for the refactored extension structure (41 lines of test updates) - All functionality should be preserved through the new clients ## Migration Impact Teams using this library will need to: 1. Update import statements to use the new specialized clients 2. Review existing code for direct `TableIngestClient` usage 3. Refactor instantiation code to use appropriate specialized client(s) 4. Test integrations thoroughly due to the architectural changes This refactoring provides a cleaner, more maintainable codebase while preserving all existing functionality through better-organized, purpose-built clients. --- 🤖 Generated with [Claude Code](https://claude.ai/code) **Branch Info:** - Source: `feature/extension-clients-refactor` - Target: `main` - Type: feature Co-Authored-By: Claude <noreply@anthropic.com>
2 parents 5333664 + cc1310c commit e10cd88

File tree

8 files changed

+828
-593
lines changed

8 files changed

+828
-593
lines changed

robosystems_client/extensions/__init__.py

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,22 @@
2828
OperationProgress,
2929
OperationResult,
3030
)
31-
from .table_ingest_client import (
32-
TableIngestClient,
33-
UploadOptions,
34-
IngestOptions,
35-
UploadResult,
31+
from .file_client import (
32+
FileClient,
33+
FileUploadOptions,
34+
FileUploadResult,
35+
FileInfo,
36+
)
37+
from .materialization_client import (
38+
MaterializationClient,
39+
MaterializationOptions,
40+
MaterializationResult,
41+
MaterializationStatus,
42+
)
43+
from .table_client import (
44+
TableClient,
3645
TableInfo,
46+
QueryResult as TableQueryResult,
3747
)
3848
from .graph_client import (
3949
GraphClient,
@@ -177,12 +187,20 @@
177187
"OperationStatus",
178188
"OperationProgress",
179189
"OperationResult",
180-
# Table Ingest Client
181-
"TableIngestClient",
182-
"UploadOptions",
183-
"IngestOptions",
184-
"UploadResult",
190+
# File Client
191+
"FileClient",
192+
"FileUploadOptions",
193+
"FileUploadResult",
194+
"FileInfo",
195+
# Materialization Client
196+
"MaterializationClient",
197+
"MaterializationOptions",
198+
"MaterializationResult",
199+
"MaterializationStatus",
200+
# Table Client
201+
"TableClient",
185202
"TableInfo",
203+
"TableQueryResult",
186204
# Graph Client
187205
"GraphClient",
188206
"GraphMetadata",

robosystems_client/extensions/extensions.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
from .query_client import QueryClient
1010
from .agent_client import AgentClient
1111
from .operation_client import OperationClient
12-
from .table_ingest_client import TableIngestClient
12+
from .file_client import FileClient
13+
from .materialization_client import MaterializationClient
14+
from .table_client import TableClient
1315
from .graph_client import GraphClient
1416
from .sse_client import SSEClient
1517

@@ -61,7 +63,9 @@ def __init__(self, config: RoboSystemsExtensionConfig = None):
6163
self.query = QueryClient(self.config)
6264
self.agent = AgentClient(self.config)
6365
self.operations = OperationClient(self.config)
64-
self.tables = TableIngestClient(self.config)
66+
self.files = FileClient(self.config)
67+
self.materialization = MaterializationClient(self.config)
68+
self.tables = TableClient(self.config)
6569
self.graphs = GraphClient(self.config)
6670

6771
def monitor_operation(
@@ -92,7 +96,12 @@ def close(self):
9296
self.query.close()
9397
self.agent.close()
9498
self.operations.close_all()
95-
self.tables.close()
99+
if hasattr(self.files, "close"):
100+
self.files.close()
101+
if hasattr(self.materialization, "close"):
102+
self.materialization.close()
103+
if hasattr(self.tables, "close"):
104+
self.tables.close()
96105
self.graphs.close()
97106

98107
# Convenience methods that delegate to the appropriate clients

0 commit comments

Comments
 (0)