- Extract lambda to named `_normalize_interval` method for testability
- Return None for NULL values to preserve NULL semantics (not 0)
- Exclude bool from numeric branch (bool is subclass of int in Python)
- Return None for unconvertible types to avoid mixed-type columns
- Add tests for zero duration, negative intervals, and bool handling
- Add INTERVAL to column spec test (NUMERIC type)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed INTERVAL values to be converted to milliseconds instead of
seconds, enabling users to use Superset's built-in "DURATION" number
format for human-readable display (e.g., "1d 2h 30m 45s" instead of
raw numeric values like "95445000").
This addresses the review feedback about making interval values more
user-friendly in charts while maintaining numeric operations.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enhanced mutator to handle multiple PostgreSQL INTERVAL formats
- Added support for timedelta, numeric, None, and string values
- Improved test coverage with comprehensive test cases
- Added documentation explaining the mutator's purpose
Addresses review comments from @korbit-ai and @giftig
PostgreSQL INTERVAL types were causing bar and pie charts to fail rendering when used as metrics. This fix converts INTERVAL values (timedelta objects) to numeric seconds so they can be properly displayed in charts.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>