msyavuz commented on code in PR #38554:
URL: https://github.com/apache/superset/pull/38554#discussion_r2930147886
##########
superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx:
##########
@@ -64,11 +65,29 @@ export const getColumnLabelText = (column: ColumnMeta):
string =>
column.verbose_name || column.column_name;
export const getColumnTypeTooltipNode = (column: ColumnMeta): ReactNode => {
- if (!column.type) {
+ const rawType = typeof column.type === 'string' ? column.type.trim() : '';
+
+ let typeLabel: ReactNode | null = null;
+
+ if (rawType && rawType.toLowerCase() !== 'column') {
+ typeLabel = rawType;
+ } else if (typeof column.type_generic === 'number') {
+ if (column.type_generic === GenericDataType.String) {
+ typeLabel = t('string');
+ } else if (column.type_generic === GenericDataType.Numeric) {
+ typeLabel = t('numeric');
+ } else if (column.type_generic === GenericDataType.Temporal) {
+ typeLabel = t('timestamp');
+ } else if (column.type_generic === GenericDataType.Boolean) {
+ typeLabel = t('boolean');
+ }
+ }
Review Comment:
So what i get from this is column.type does not always exist when
type_generic does. Is that right?
--
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]