prefect-ui-library icon indicating copy to clipboard operation
prefect-ui-library copied to clipboard

Unable to create maps where the source is an array

Open pleek91 opened this issue 1 year ago • 0 comments

Issue

Since mapper.map automatically maps over arrays we're unable to create maps that take the entire array as a source. Which means we cannot write mappers to convert an array to an object which is quite useful.

Proposal

Separate out array mapping into a separate method similar to mapEntries. Possibly mapArray. And update map to only work on single values.

Breaking Change

Doing this would be a breaking change since many of our mappers rely on mapper.map accepting an array and mapping over each value individually.

Unknowns

Will the types work correctly?

pleek91 avatar Sep 11 '23 18:09 pleek91