codeant-ai-for-open-source[bot] commented on code in PR #45439:
URL: https://github.com/apache/superset/pull/45439#discussion_r4320934362


##########
superset/charts/client_processing.py:
##########
@@ -851,18 +869,37 @@ def format_column(
     parallel ``currency_context`` series is present, AUTO uses each row/cell's
     contributing currencies first. Mixed context renders a neutral number;
     empty context optionally falls back to query-wide detection.
+
+    ``small_d3_format`` is the column's small-number format. The choice is per
+    cell rather than per column, matching ``formatColumnValue``: a value below
+    one in absolute value takes that format with the column config's own
+    currency, exactly what ``getSmallNumberFormatter`` builds, and every other
+    value keeps the column's normal format.
     """
-    if d3_format or currency.get("symbol"):
+    if d3_format or currency.get("symbol") or small_d3_format:
         if currency_context is None:
             resolved_currency = resolve_auto_currency(currency, 
detected_currency)
-            df[column] = df[column].apply(
-                partial(format_number_with_config, d3_format, 
resolved_currency)
+            format_value = partial(
+                format_number_with_config, d3_format, resolved_currency
             )
+            if small_d3_format:
+                format_small = partial(
+                    format_number_with_config, small_d3_format, small_currency 
or {}
+                )
+                df[column] = df[column].apply(
+                    lambda value: format_small(value)
+                    if is_small_number(value)
+                    else format_value(value)
+                )
+                return
+            df[column] = df[column].apply(format_value)
             return
 
         contexts = currency_context.reindex(df.index)
         df[column] = [
-            format_number_with_config(
+            format_number_with_config(small_d3_format, small_currency or {}, 
value)
+            if small_d3_format and is_small_number(value)

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `c6ec3ce`.
   
   The small-number branch now resolves its currency using each row’s context 
before formatting the value.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



-- 
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]

Reply via email to