fix(transform): Use path instead of field name for PK options#739
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #739 +/- ##
==========================================
+ Coverage 43.15% 43.21% +0.05%
==========================================
Files 80 80
Lines 7886 7889 +3
==========================================
+ Hits 3403 3409 +6
+ Misses 4015 4013 -2
+ Partials 468 467 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
cec4f3f to
99e2a2e
Compare
⏱️ Benchmark resultsComparing with 72c2cc0
|
|
Could you please add a description to explain what this fixes? It's useful for reviewers and for users who might later need to understand what this change did. |
|
@hermanschaaf I've added a more detailed explanation for this change in the PR description |
|
Nice, thanks for the detailed description @candiduslynx, makes sense 👍 |
erezrokah
left a comment
There was a problem hiding this comment.
Looks great, thanks for adding the detailed description
🤖 I have created a release *beep* *boop* --- ## [1.44.1](v1.44.0...v1.44.1) (2023-03-31) ### Bug Fixes * **transform:** Use path instead of field name for PK options ([#739](#739)) ([d7649d8](d7649d8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
follow-up for #9498 as cloudquery/plugin-sdk#739 was released & merged
follow-up for #9498 as cloudquery/plugin-sdk#739 was released & merged
While using
transformers.WithPrimaryKeysoption there is an odd behavior being observed, where the unwrapped struct field also gets promoted to be PK.Consider the following example:
Currently, if
transformers.WithPrimaryKeys("ID")option was used to transform structAwe would get the following columns:id: PK, taken fromAb_id: PK, taken fromBHowever, with the current change, the following becomes possible:
transformers.WithPrimaryKeysidis PKb_idis PK"ID"truefalse"B.ID"falsetrue"ID", "B.ID"truetrue