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: sql_json view endpoint #16441

Merged
merged 4 commits into from
Aug 25, 2021

Conversation

ofekisr
Copy link
Contributor

@ofekisr ofekisr commented Aug 25, 2021

SUMMARY

The sql_json view code in superset core view without any "clean code" standard and it does not adopt any software development principle.
This is the first PR in the sequence of future PRs try to solve it by refactoring the code.
The PR focus of encapsulation all the request.json parameters into one execution_context object so all the parameters could be passed to small function as one object

TESTING INSTRUCTIONS

there are no logic changes so it implies on the current tests.

@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #16441 (4b85e29) into master (08b8aa2) will decrease coverage by 0.19%.
The diff coverage is 91.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16441      +/-   ##
==========================================
- Coverage   76.61%   76.41%   -0.20%     
==========================================
  Files        1001     1002       +1     
  Lines       53534    53585      +51     
  Branches     6821     6821              
==========================================
- Hits        41015    40948      -67     
- Misses      12280    12398     +118     
  Partials      239      239              
Flag Coverage Δ
hive ?
mysql 81.52% <91.25%> (-0.02%) ⬇️
postgres 81.59% <91.56%> (+0.02%) ⬆️
presto ?
python 81.67% <91.56%> (-0.40%) ⬇️
sqlite 81.23% <91.25%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
superset/utils/sqllab_execution_context.py 90.14% <90.14%> (ø)
superset/views/core.py 75.30% <100.00%> (+<0.01%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.80% <0.00%> (-16.87%) ⬇️
superset/db_engine_specs/presto.py 83.47% <0.00%> (-6.49%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.04% <0.00%> (-1.66%) ⬇️
superset/db_engine_specs/base.py 88.00% <0.00%> (-0.39%) ⬇️
superset/models/core.py 89.14% <0.00%> (-0.26%) ⬇️
superset/utils/core.py 89.86% <0.00%> (-0.13%) ⬇️
... and 1 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 08b8aa2...4b85e29. 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.

LGTM!
just a small nameing comment

@amitmiran137 amitmiran137 merged commit 93c60e4 into apache:master Aug 25, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Aug 26, 2021
* upstream/master: (25 commits)
  chore(ci): bump pylint to 2.10.2 (apache#16463)
  fix: prevent page crash when chart can't render (apache#16464)
  chore: fixed slack invite link (apache#16466)
  fix(native-filters): handle null values in value filter (apache#16460)
  feat: add function list to auto-complete to Clickhouse datasource (apache#16234)
  refactor(explore): improve typing for Dnd controls (apache#16362)
  fix(explore): update overwrite button on perm change (apache#16437)
  feat: Draggable and Resizable Modal (apache#16394)
  refactor: sql_json view endpoint (apache#16441)
  fix(dashboard): undo and redo buttons weird alignment  (apache#16417)
  fix: setupPlugin in chart list page (apache#16413)
  fix: Disable Slack notification method if no api token (apache#16367)
  feat: add Shillelagh DB engine spec (apache#16416)
  fix: copy to Clipboard order (apache#16299)
  docs: make FEATURE_FLAGS.md reference a link (apache#16415)
  chore(viz): bump superset-ui to 0.17.87 (apache#16420)
  feat: add activate command (apache#16404)
  Revert "fix(explore): let admin overwrite slice (apache#16290)" (apache#16408)
  fix(explore): retain chart ownership on query context update (apache#16419)
  chore: Removes the TODOs and uses the default page size (apache#16422)
  ...
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* refactor sql_json view endpoint

* fix pylint

* renaming

* renaming

Co-authored-by: Amit Miran <47772523+amitmiran137@users.noreply.github.com>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* refactor sql_json view endpoint

* fix pylint

* renaming

* renaming

Co-authored-by: Amit Miran <47772523+amitmiran137@users.noreply.github.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.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/L 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants