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: encapsulate ctas parameters #16548

Merged
merged 3 commits into from
Sep 5, 2021

Conversation

ofekisr
Copy link
Contributor

@ofekisr ofekisr commented Sep 1, 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 fourth PR in the sequence of future PRs (previous PR) try to solve it by refactoring the code.
The PR focus of encapsulating ctas (create table as select) parameters
TESTING INSTRUCTIONS
there are no logic changes so it implies on the current tests.

@codecov
Copy link

codecov bot commented Sep 5, 2021

Codecov Report

Merging #16548 (e9b794b) into master (e947f8a) will increase coverage by 0.02%.
The diff coverage is 94.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16548      +/-   ##
==========================================
+ Coverage   76.71%   76.74%   +0.02%     
==========================================
  Files        1002     1003       +1     
  Lines       53801    53856      +55     
  Branches     6858     6858              
==========================================
+ Hits        41276    41330      +54     
- Misses      12288    12289       +1     
  Partials      237      237              
Flag Coverage Δ
hive 81.11% <94.00%> (+0.03%) ⬆️
mysql 81.57% <93.75%> (+0.03%) ⬆️
postgres 81.60% <94.00%> (+0.03%) ⬆️
presto 81.40% <94.00%> (+0.03%) ⬆️
python 82.11% <94.00%> (+0.03%) ⬆️
sqlite 81.25% <93.75%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
superset/views/core.py 75.57% <75.00%> (-0.02%) ⬇️
superset/utils/sqllab_execution_context.py 91.81% <95.65%> (+1.67%) ⬆️
superset/jinja_context.py 89.36% <0.00%> (ø)
superset/db_engine_specs/__init__.py 50.00% <0.00%> (ø)
superset/db_engine_specs/aurora.py 100.00% <0.00%> (ø)
superset/tasks/async_queries.py 96.96% <0.00%> (+0.19%) ⬆️
superset/views/utils.py 83.57% <0.00%> (+0.24%) ⬆️
superset/db_engine_specs/rockset.py 53.12% <0.00%> (+1.60%) ⬆️

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 e947f8a...e9b794b. Read the comment docs.

@@ -63,6 +63,7 @@
QUERY_3 = "SELECT * FROM birth_names LIMIT 10"


@pytest.mark.sqllab
class TestSqlLab(SupersetTestCase):
Copy link
Member

Choose a reason for hiding this comment

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

Remove that custom mark

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.

A few minor comments

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.

Another small refactor
Look good
Minor comments will be addressed in the following PR

@amitmiran137 amitmiran137 merged commit be77ad2 into apache:master Sep 5, 2021
villebro pushed a commit to preset-io/superset that referenced this pull request Sep 6, 2021
…#16548)

* refactor sql_json view endpoint: encapsulate ctas parameters

* fix failed tests

* fix failed tests and ci issues
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
…#16548)

* refactor sql_json view endpoint: encapsulate ctas parameters

* fix failed tests

* fix failed tests and ci issues
villebro added a commit that referenced this pull request Nov 15, 2021
* add support for adhoc columns to api and sqla model

* fix some types

* fix duplicates in column names

* fix more lint

* fix schema and dedup

* clean up some logic

* first pass at fixing viz.py

* Add frontend support for adhoc columns

* Add title edit

* Fix showing custom title

* Use column name as default value in sql editor

* fix: Adds a loading message when needed in the Select component (#16531)

* fix(tests): make parquet select deterministic with order by (#16570)

* bump emotion to help with cache clobbering (#16559)

* fix: Support Jinja template functions in global async queries (#16412)

* Support Jinja template functions in async queries

* Pylint

* Add tests for async tasks

* Remove redundant has_request_context check

* fix: impersonate user label/tooltip (#16573)

* docs: update for small typos (#16568)

* feat: Add Aurora Data API engine spec (#16535)

* feat: Add Aurora Data API engine spec

* Fix lint

* refactor: sql_json view endpoint: encapsulate ctas parameters (#16548)

* refactor sql_json view endpoint: encapsulate ctas parameters

* fix failed tests

* fix failed tests and ci issues

* refactor sql_json view endpoint: separate concern into ad hod method (#16595)

* feat: Experimental cross-filter plugins (#16594)

* fix:fix get permission function

* feat: add cross filter chart in charts gallery under FF

* chore(deps): bump superset-ui to 0.18.2 (#16601)

* update type guard references

* fix imports

* update series_columns schema

* Add changes that got lost in rebase

* Use current columns name or expression as sql editor init value

* add integration test and do minor fixes

* Bump superset-ui

* fix linting issue

* bump superset-ui to 0.18.22

* resolve merge conflict

* lint

* fix select filter infinite loop

* bump superset-ui to 0.18.23

* Fix auto setting column popover title

* Enable adhoc columns only if UX_BETA enabled

* put back removed test

* Move popover height and width to constants

* Refactor big ternary expression

Co-authored-by: Kamil Gabryjelski <[email protected]>
Co-authored-by: Michael S. Molina <[email protected]>
Co-authored-by: Elizabeth Thompson <[email protected]>
Co-authored-by: Rob DiCiuccio <[email protected]>
Co-authored-by: Beto Dealmeida <[email protected]>
Co-authored-by: joeADSP <[email protected]>
Co-authored-by: ofekisr <[email protected]>
Co-authored-by: simcha90 <[email protected]>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
…#16548)

* refactor sql_json view endpoint: encapsulate ctas parameters

* fix failed tests

* fix failed tests and ci issues
AAfghahi pushed a commit that referenced this pull request Jan 10, 2022
* add support for adhoc columns to api and sqla model

* fix some types

* fix duplicates in column names

* fix more lint

* fix schema and dedup

* clean up some logic

* first pass at fixing viz.py

* Add frontend support for adhoc columns

* Add title edit

* Fix showing custom title

* Use column name as default value in sql editor

* fix: Adds a loading message when needed in the Select component (#16531)

* fix(tests): make parquet select deterministic with order by (#16570)

* bump emotion to help with cache clobbering (#16559)

* fix: Support Jinja template functions in global async queries (#16412)

* Support Jinja template functions in async queries

* Pylint

* Add tests for async tasks

* Remove redundant has_request_context check

* fix: impersonate user label/tooltip (#16573)

* docs: update for small typos (#16568)

* feat: Add Aurora Data API engine spec (#16535)

* feat: Add Aurora Data API engine spec

* Fix lint

* refactor: sql_json view endpoint: encapsulate ctas parameters (#16548)

* refactor sql_json view endpoint: encapsulate ctas parameters

* fix failed tests

* fix failed tests and ci issues

* refactor sql_json view endpoint: separate concern into ad hod method (#16595)

* feat: Experimental cross-filter plugins (#16594)

* fix:fix get permission function

* feat: add cross filter chart in charts gallery under FF

* chore(deps): bump superset-ui to 0.18.2 (#16601)

* update type guard references

* fix imports

* update series_columns schema

* Add changes that got lost in rebase

* Use current columns name or expression as sql editor init value

* add integration test and do minor fixes

* Bump superset-ui

* fix linting issue

* bump superset-ui to 0.18.22

* resolve merge conflict

* lint

* fix select filter infinite loop

* bump superset-ui to 0.18.23

* Fix auto setting column popover title

* Enable adhoc columns only if UX_BETA enabled

* put back removed test

* Move popover height and width to constants

* Refactor big ternary expression

Co-authored-by: Kamil Gabryjelski <[email protected]>
Co-authored-by: Michael S. Molina <[email protected]>
Co-authored-by: Elizabeth Thompson <[email protected]>
Co-authored-by: Rob DiCiuccio <[email protected]>
Co-authored-by: Beto Dealmeida <[email protected]>
Co-authored-by: joeADSP <[email protected]>
Co-authored-by: ofekisr <[email protected]>
Co-authored-by: simcha90 <[email protected]>
@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