[CDK] Ability to apply custom transformation to specific properties #33782
thearchitector
started this conversation in
Connector Ideas and Features
Replies: 1 comment
-
Move this to discussions as it is a feature request or improvement. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Topic
Add support for transformation and normalization of specific fields
Relevant information
The entry point for custom transformers in the CDK is
Only the schema for, and value of, fields are passed to this function, making it unpleasant to apply transformations to specific fields coming out of records. It would be useful to be able to see the actual field name in addition to its value and schema.
Practically, I think that would just be a matter of passing
k
as well asinstance[k]
to the transformer function here; resolution forlist
items could potentially pass the name of the parent field.Alternatively, we could pass
field_path
wherefield_path
is the location of the field from the root JSON (so the path for fieldB
nested in objectA
would be["A", "B"]
, with some analogous for list items). Whatever the case, I think it would make sense to match the same JSON-path-like list supported byprimary_key
and the others.It would also be neat to support whole-record transformations for operations that require knowledge/the context of the other fields in a record; so not field-by-field transformations, but also record-by-record ones. The latter could be somewhat supported by passing the entire record original instance to every transformer call, basically another
original_record
parameter to the fn to an extent, but would not enable the aggregation or deletion of fields from the original record (which is a logical desire).Beta Was this translation helpful? Give feedback.
All reactions