bmuraykhi opened a new issue, #45783:
URL: https://github.com/apache/superset/issues/45783
### Bug description
### Bug description
With a time shift and **Show full range for time shift** (#41334) on, a
chart fails with "Data error: One or more chart-data queries failed" when the
shifted period has no rows. With the option off, the same chart renders fine.
Present in `7.0.0rc2` and `master`.
An empty offset result becomes a one-row NaN placeholder. The full-range
outer join keeps that row, and `_coalesce_offset_index` fails on it:
```
File "superset/models/helpers.py", line 3751, in _coalesce_offset_index
shifted = df[offset_x_axis] - forward_shift
TypeError: unsupported operand type(s) for -: 'numpy.ndarray' and
'DateOffset'
```
### How to reproduce
1. Line Chart with a time grain on a dataset that has no data a week before
the selected range.
2. Time shift `1 week ago`: the chart renders.
3. Tick **Show full range for time shift**: "Data error", and
`/api/v1/chart/data` returns 500.
### Screenshots/recordings
<img width="980" height="856" alt="Image"
src="https://github.com/user-attachments/assets/5f3aec75-361c-4816-88dc-7bd3b29570d0"
/>
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.11
### Node version
Not applicable
### Browser
Not applicable
### Additional context
Reproduced on `7.0.0rc2` with ClickHouse and on `master` in a unit test. It
is in the pandas post-processing, so any engine is affected.
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [x] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
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]