aminghadersohi opened a new pull request, #35587:
URL: https://github.com/apache/superset/pull/35587
### SUMMARY
Fixes a production error where timezone-aware datetime columns from database
query results failed to convert to PyArrow tables.
**Error**: `ValueError: Tz-aware datetime.datetime cannot be converted to
datetime64 unless utc=True`
**Root Cause**: When pandas encounters timezone-aware datetime objects, it
requires the `utc=True` parameter in `pd.to_datetime()` to properly handle
timezone information.
**Solution**: Added `utc=True` parameter to `pd.to_datetime()` call in
`superset/result_set.py:173`
This ensures timezone information is preserved when converting query results
to PyArrow tables while maintaining backward compatibility with existing
timezone-naive datetime handling.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - Backend fix
### TESTING INSTRUCTIONS
1. Run the existing unit test that covers this scenario:
```bash
pytest tests/unit_tests/result_set_test.py::test_timezone_series -v
```
2. The test verifies that timezone-aware datetimes are correctly converted
without raising exceptions
3. All 5 unit tests in `result_set_test.py` pass
### ADDITIONAL INFORMATION
- [ ] 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
--
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]