apache / apache/superset

Superset 6.0.0 with Oracle: DB engine error during numeric division/casting in charts

Open
#39,324 2 comments 0 reactions 0 assignees View on GitHub
#bug:regression data:connect:oracle requires:more-info validation:required
Dominant language
Python
Stars
74.8k
Forks
18.3k
Avg merge
2d 5h
Merged PRs (30d)
685

Description

### Bug description

Hi, we are seeing an issue after upgrading from Superset 4.1.4 to 6.0.0 with an Oracle backend.

In one of our charts, some numeric values are stored scaled in the database and are converted back at query time by dividing by a system factor. After the upgrade, certain charts intermittently fail with a DB engine error similar to:
Could not convert string '0' to numeric
Observations:
This did not happen in our older Superset version.
If we remove the division/conversion logic, the chart runs, but the values are no longer correct because they remain scaled.

ex of query:

ROUND(
MAX(CASE WHEN some_type = 'X' THEN TO_NUMBER(some_value) END)
/ NULLIF((SELECT TO_NUMBER(pref_value) FROM some_preferences WHERE pref_key = 'FACTOR'), 0),
2
)

Has anyone else faced similar issues?

### Screenshots/recordings

Image

### Superset version

6.0.0

### Python version

3.11

### Node version

Not applicable

### Browser

Chrome

### Additional context

_No response_

### 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.
- [ ] 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.

Contributor guide

Open the contributing guide

Research direction

Start with the Oracle-backed chart query shown in the report and compare its behavior between Superset 4.1.4 and 6.0.0. No source file or test is identified; done means isolating the regression and documenting a reproducible failing case or regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
data-visualization, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.