Skip to content

Conversation

@betodealmeida
Copy link
Member

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Presto queries that return no data are raising the exception "too many indices for array". This happens because the Numpy array that wraps the data has shape (0,), and when we create the Pandas time series for the dataframe we try to access each column using index [:,i].

I fixed it by reshaping the array to 2D, even if empty. Query now succeeds with "The query returned no data".

TEST PLAN

I tested the failing query, and also added a unit test. I also added a unit test for #8253.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@khtruong

@codecov-io
Copy link

codecov-io commented Sep 20, 2019

Codecov Report

Merging #8268 into master will decrease coverage by 5.78%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8268      +/-   ##
==========================================
- Coverage    73.5%   67.72%   -5.79%     
==========================================
  Files         115      451     +336     
  Lines       12371    22674   +10303     
  Branches        0     2370    +2370     
==========================================
+ Hits         9093    15355    +6262     
- Misses       3278     7182    +3904     
- Partials        0      137     +137
Impacted Files Coverage Δ
superset/dataframe.py 94.48% <100%> (ø) ⬆️
...sets/src/explore/components/ExploreChartHeader.jsx 50% <0%> (ø)
superset/assets/src/components/Checkbox.jsx 100% <0%> (ø)
...perset/assets/src/dashboard/util/getEmptyLayout.js 0% <0%> (ø)
...ts/src/dashboard/util/getComponentWidthFromDrop.js 95.23% <0%> (ø)
.../assets/src/dashboard/reducers/dashboardFilters.js 88.23% <0%> (ø)
...rc/explore/components/controls/AnnotationLayer.jsx 2.46% <0%> (ø)
superset/assets/src/welcome/DashboardTable.jsx 87.5% <0%> (ø)
...erset/assets/src/dashboard/util/injectCustomCss.js 91.66% <0%> (ø)
...explore/components/controls/ColorPickerControl.jsx 85% <0%> (ø)
... and 327 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 731c19b...87ac1ee. Read the comment docs.

@betodealmeida betodealmeida merged commit 7090725 into apache:master Sep 20, 2019
betodealmeida added a commit that referenced this pull request Sep 20, 2019
* Fix no data in Presto

* Fix test
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Sep 30, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 First shipped in 0.35.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 0.35.0 First shipped in 0.35.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants