Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ChartData): move chart_data_apis from ChartRestApi ChartDataRestApi #17400

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

ofekisr
Copy link
Contributor

@ofekisr ofekisr commented Nov 11, 2021

Background

When we have worked on #16991 we wanted to test the new functionalities in concrete and accurate unittest.
All chartData flows and its components are too couple to superset so it is impossible to create unittests.
The flows are not testable and so many components do not meet the very important principle SRP and the code became so dirty

So I've started to refactor it (#17344 ) but many changes were added and it was hard to review so I decided to split those changes into small PRs so will be easier to follow

This is the second PR
The next PR is #17405

PR description

Create new view - ChartDataRestApi in new module but inherit ChartRestApi
then moves all chart data endpoints to that new view so the view will be focused only on chartData

Test plans

There are no logic changes so new tests are not required
but in the next PRs, I'll split the API tests into new separate modules and classes

Previous PRs

  1. refactor(ChartData): move ChartDataResult enums to common #17399

@codecov
Copy link

codecov bot commented Nov 11, 2021

Codecov Report

Merging #17400 (9d26abb) into master (45480f7) will increase coverage by 0.06%.
The diff coverage is 88.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17400      +/-   ##
==========================================
+ Coverage   76.95%   77.02%   +0.06%     
==========================================
  Files        1039     1040       +1     
  Lines       56033    56074      +41     
  Branches     7735     7735              
==========================================
+ Hits        43120    43189      +69     
+ Misses      12655    12627      -28     
  Partials      258      258              
Flag Coverage Δ
hive 81.46% <88.48%> (-0.03%) ⬇️
mysql 81.89% <88.48%> (-0.03%) ⬇️
postgres 81.90% <88.48%> (-0.03%) ⬇️
presto 81.77% <88.48%> (?)
python 82.40% <88.48%> (+0.12%) ⬆️
sqlite 81.57% <88.48%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/reports/commands/execute.py 91.22% <ø> (ø)
superset/charts/data/api.py 88.23% <88.23%> (ø)
superset/charts/api.py 81.05% <100.00%> (-4.82%) ⬇️
superset/initialization/__init__.py 87.98% <100.00%> (+0.08%) ⬆️
superset/models/core.py 90.00% <0.00%> (+0.73%) ⬆️
superset/connectors/sqla/models.py 87.97% <0.00%> (+1.38%) ⬆️
superset/db_engine_specs/presto.py 90.37% <0.00%> (+6.06%) ⬆️

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 45480f7...9d26abb. Read the comment docs.

Copy link
Member

@amitmiran137 amitmiran137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, 3 endpoints we're moved from 1 module to another

@amitmiran137 amitmiran137 merged commit 28944f5 into apache:master Nov 11, 2021
@ofekisr ofekisr deleted the refactor/chart_data_flows_2 branch November 11, 2021 15:15
AAfghahi pushed a commit that referenced this pull request Jan 10, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 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/XL 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants