Skip to content

Commit a50f0e7

Browse files
authored
fix: SyncMigrateTableMessage should have the pa.Schema argument named as "table" (#13)
Co-authored-by: Kemal Hadimli <[email protected]>
1 parent 0d05fc8 commit a50f0e7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cloudquery/sdk/internal/servers/plugin_v3/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def Sync(self, request, context):
6161
insert=plugin_pb2.Sync.MessageInsert(record=buf)
6262
)
6363
elif isinstance(msg, SyncMigrateTableMessage):
64-
buf = arrow.schema_to_bytes(msg.schema)
64+
buf = arrow.schema_to_bytes(msg.table)
6565
yield plugin_pb2.Sync.Response(
6666
migrate_table=plugin_pb2.Sync.MessageMigrateTable(table=buf)
6767
)

cloudquery/sdk/message/sync.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ class SyncMessage:
55
pass
66

77

8-
class SyncInsertMessage:
8+
class SyncInsertMessage(SyncMessage):
99
def __init__(self, record: pa.RecordBatch):
1010
self.record = record
1111

1212

13-
class SyncMigrateTableMessage:
14-
def __init__(self, schema: pa.Schema):
15-
self.schema = schema
13+
class SyncMigrateTableMessage(SyncMessage):
14+
def __init__(self, table: pa.Schema):
15+
self.table = table

cloudquery/sdk/scheduler/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def sync(
174174
) -> Generator[SyncMessage, None, None]:
175175
res = queue.Queue()
176176
for resolver in resolvers:
177-
yield SyncMigrateTableMessage(schema=resolver.table.to_arrow_schema())
177+
yield SyncMigrateTableMessage(table=resolver.table.to_arrow_schema())
178178
thread = futures.ThreadPoolExecutor()
179179
thread.submit(self._sync, client, resolvers, res, deterministic_cq_id)
180180
total_table_resolvers = 0

0 commit comments

Comments
 (0)