IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
5 stars 24 forks source link

Fix/data pipe merge nested #2344

Closed chrismclarke closed 9 hours ago

chrismclarke commented 1 week ago

PR Checklist

Description

Builds on top of #2342 to address specific bug where _translations data could not be included in in the base data_list of a merge operator.

Review Notes

Only changes beyond #2342 are to address the bug identified in #2343. So if functional testing passed should be able to assume good to go (I've already reviewed the code written in #2342 and seen changes since)

Dev Notes

The core issue appeared to be a bug within the danfo.js dataframe apply method - this should pass an array of all row values to manipulate, however it omitted any values that were formatted as nested json, and hence when using a _translations column the overall return array would be 1 element shorter than expected (dimension error).

I've updated the test spec to cover, runnable via yarn workspace shared test See screenshots below for before/after (should capture same issue seen).

I've also changed the console error on empty data frame to throw, and included in the tests so that it is more explicit to any author (thrown errors are identified in final output logs whereas console errors can be more easily missed)

Git Issues

Closes #2343

Screenshots/Videos

Tests - Before image

Tests - After image