msyavuz commented on code in PR #38579:
URL: https://github.com/apache/superset/pull/38579#discussion_r2939192906
##########
superset-frontend/src/visualizations/TimeTable/utils/sortUtils/sortUtils.test.ts:
##########
@@ -86,7 +77,7 @@ describe('sortNumberWithMixedTypes', () => {
const result = sortNumberWithMixedTypes(rowA, rowB, 'testColumn', false);
- expect(result).toBeLessThan(0);
+ expect(typeof result).toBe('number');
Review Comment:
This also seems relevant
##########
superset-frontend/src/visualizations/TimeTable/utils/sortUtils/sortUtils.ts:
##########
@@ -42,23 +44,59 @@ function compareValues(
}
/**
- * Sorts table rows with mixed data types for react-table
- * @param rowA - First row to compare
- * @param rowB - Second row to compare
- * @param columnId - Column identifier for sorting
- * @param descending - Whether to sort in descending order
- * @returns Numeric comparison result for react-table
+ * Sorts table rows with mixed data types for react-table.
+ *
+ * react-table handles the asc/desc direction flip internally after calling
+ * this function, so we only return the raw comparison result.
Review Comment:
Also can we keep the function docs here. I think that's helpful.
--
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]