Skip to content

Commit 37b7bf2

Browse files
authored
fix: Flatten tables in plugin server getTables call (#41)
Same as the Go implementation, the table list should be flattened before sending it over the wire: https://github.com/cloudquery/plugin-sdk/blob/main/schema/table.go#L204
1 parent e7c2134 commit 37b7bf2

File tree

1 file changed

+3
-1
lines changed
  • cloudquery/sdk/internal/servers/plugin_v3

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
)
1515
from cloudquery.sdk.plugin.plugin import Plugin, SyncOptions, TableOptions
1616
from cloudquery.sdk.schema import tables_to_arrow_schemas, Table
17+
from cloudquery.sdk.schema.table import flatten_tables
1718

1819

1920
class PluginServicer(plugin_pb2_grpc.PluginServicer):
@@ -39,7 +40,8 @@ def GetTables(self, request: plugin_pb2.GetTables.Request, context):
3940
skip_dependent_tables=request.skip_dependent_tables,
4041
)
4142
)
42-
schema = tables_to_arrow_schemas(tables)
43+
flattened_tables = flatten_tables(tables)
44+
schema = tables_to_arrow_schemas(flattened_tables)
4345
tablesBytes = []
4446
for s in schema:
4547
sink = pa.BufferOutputStream()

0 commit comments

Comments
 (0)