dosubot[bot] commented on issue #31763: URL: https://github.com/apache/superset/issues/31763#issuecomment-2579606904
<!-- Answer --> The issue you're experiencing with inconsistent label translation in pivot tables might be related to how the `namesMapping` object is being handled in the `TableRenderer` component. This object is responsible for mapping column names to their configured labels. If the `namesMapping` is not correctly populated or passed, it can default to using the literal column names, which could explain the random behavior you're seeing. To address this, ensure that the `namesMapping` prop is correctly set and contains all necessary mappings from column names to their desired labels. This mapping should be passed to the `TableRenderer` component, structured as an object where keys are the column names and values are the corresponding labels <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx)</sup>. Since the issue appears to be random and resolves when opening the chart in edit mode, it might be worth checking if there are any asynchronous data fetching or state management issues that could cause the `namesMapping` object to be inconsistently populated. Additionally, ensure that there are no caching mechanisms or feature flags affecting the rendering of labels in pivot tables. If the problem persists, consider reviewing the code related to how props are passed to the `TableRenderer` component, particularly focusing on the `PivotTable` component, which is responsible for passing these props <sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/PivotTable.jsx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/86676c6f-3250-4545-b49b-bc10a687d16d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/86676c6f-3250-4545-b49b-bc10a687d16d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/86676c6f-3250-4545-b49b-bc10a687d16d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/86676c6f-3250-4545-b49b-bc10a687d16d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/86676c6f-3250-4545-b49b-bc10a687d16d?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/86676c6f-3250-4545-b49b-bc10a687d16d?feedback_type=other)</sup> -- 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]
