mtrentz opened a new pull request, #28038: URL: https://github.com/apache/superset/pull/28038
## **User description** ### SUMMARY Previously when the value of a BigNumber was zero (falsey) the expression to evaluate colors always got evaluated to false. Meaning that if my condition was `number <= 50` and my number was 0, it wouldn't color it. It would work if it was `0.1`. Related to this issue: #21820 Most recent discussion around this PR #23064 ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> - Tested if colors when BigNumber is zero - Tested if still works for negative, floats, and scientific notation numbers like `1e-100` ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API ___ ## **CodeAnt-AI Description** Fix BigNumber color formatting for zero values and add tests ### What Changed - BigNumber color thresholds are applied when the value is exactly 0 (previously skipped because 0 was treated as falsy) - Color formatting still applies for positive and negative numeric values, and is not applied for null or undefined values - New unit tests validate coloring behavior for 0, positive, negative, null, and undefined cases ### Impact `✅ Correct color for zero values` `✅ Fewer uncolored zero big numbers in dashboards` `✅ Verified coloring behavior with unit tests` <details> <summary><strong>💡 Usage Guide</strong></summary> ### Checking Your Pull Request Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later. ### Talking to CodeAnt AI Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask: <pre> <code>@codeant-ai ask: Your question here</code> </pre> This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code. #### Example <pre> <code>@codeant-ai ask: Can you suggest a safer alternative to storing this secret?</code> </pre> ### Preserve Org Learnings with CodeAnt You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input: <pre> <code>@codeant-ai: Your feedback here</code> </pre> This helps CodeAnt AI learn and adapt to your team's coding style and standards. #### Example <pre> <code>@codeant-ai: Do not flag unused imports.</code> </pre> ### Retrigger review Ask CodeAnt AI to review the PR again, by typing: <pre> <code>@codeant-ai: review</code> </pre> ### Check Your Repository Health To analyze the health of your code repository, visit our dashboard at [https://app.codeant.ai](https://app.codeant.ai). This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health. </details> -- 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]
