korbit-ai[bot] commented on code in PR #34014:
URL: https://github.com/apache/superset/pull/34014#discussion_r2177855258
##########
superset-frontend/plugins/plugin-chart-table/src/transformProps.ts:
##########
@@ -471,6 +472,11 @@ const transformProps = (
emitCrossFilters,
} = chartProps;
+ const formData = {
+ ...originalFormData,
+ ...originalFormData.extra_form_data,
+ } as TableChartFormData;
Review Comment:
### Shallow Merge of Configuration Objects <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The code merges extra_form_data at the root level, which means nested
properties in extra_form_data will not be properly merged with their
counterparts in originalFormData.
###### Why this matters
If extra_form_data contains nested objects, they will completely override
the corresponding objects in originalFormData instead of being deeply merged.
This can lead to loss of configuration data.
###### Suggested change ∙ *Feature Preview*
Use a deep merge function to properly combine the objects:
```typescript
import { merge } from 'lodash';
const formData = merge({}, originalFormData,
originalFormData.extra_form_data) as TableChartFormData;
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ca148bd-1e1c-4318-a8db-f0c30a4a9ec3/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ca148bd-1e1c-4318-a8db-f0c30a4a9ec3?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ca148bd-1e1c-4318-a8db-f0c30a4a9ec3?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ca148bd-1e1c-4318-a8db-f0c30a4a9ec3?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ca148bd-1e1c-4318-a8db-f0c30a4a9ec3)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:3db57a5b-762c-472e-acd2-bdfe3c08eeaa -->
[](3db57a5b-762c-472e-acd2-bdfe3c08eeaa)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]