-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Report table errors from plugins via gRPC #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
670eeab
to
d30be5c
Compare
@@ -77,6 +78,12 @@ def Sync(self, request, context): | |||
yield plugin_pb2.Sync.Response( | |||
migrate_table=plugin_pb2.Sync.MessageMigrateTable(table=buf) | |||
) | |||
elif isinstance(msg, SyncErrorMessage) and request.withErrorMessages: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change (part 1) to add the feature
@@ -162,6 +163,7 @@ def resolve_table( | |||
depth=depth, | |||
exc_info=e, | |||
) | |||
res.put(SyncErrorMessage(resolver.table.name, str(e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change (part 2) to add the feature
for msg in response: | ||
if msg.insert is not None: | ||
message_type = msg.WhichOneof("message") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg.WhichOneof("message")
is the correct way to know the message type.
On other non insert message the condition msg.insert is not None
is true as well
🤖 I have created a release *beep* *boop* --- ## [0.1.47](v0.1.46...v0.1.47) (2025-09-03) ### Features * Report table errors from plugins via gRPC ([#320](#320)) ([79d026e](79d026e)) ### Bug Fixes * **deps:** Update dependency cloudquery-plugin-pb to v0.0.47 ([#318](#318)) ([cc679a3](cc679a3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Fixes cloudquery/cloudquery#15525, the Python equivalent of cloudquery/plugin-sdk#2195
Most of the changes are actually to the MemDB plugin
(that's why tests are failing, PR in draft while I fix those), as I turned it into a "real" plugin that uses the SDK scheduler so I can test this change.