Skip to content

Conversation

erezrokah
Copy link
Member

@erezrokah erezrokah commented Sep 2, 2025

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.

@erezrokah erezrokah force-pushed the feat/report_sync_errors_over_grpc branch from 670eeab to d30be5c Compare September 2, 2025 18:57
@@ -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:
Copy link
Member Author

@erezrokah erezrokah Sep 3, 2025

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)))
Copy link
Member Author

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")
Copy link
Member Author

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

@erezrokah erezrokah marked this pull request as ready for review September 3, 2025 11:27
@erezrokah erezrokah added the automerge Add to automerge PRs once requirements are met label Sep 3, 2025
@kodiakhq kodiakhq bot merged commit 79d026e into main Sep 3, 2025
9 checks passed
@kodiakhq kodiakhq bot deleted the feat/report_sync_errors_over_grpc branch September 3, 2025 12:28
kodiakhq bot pushed a commit that referenced this pull request Sep 3, 2025
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Add to automerge PRs once requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Python SDK doesn't handle Exceptions raised in TableResolver.resolve as expected
2 participants