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

chore: Added unit test to query context change #17624

Merged
merged 6 commits into from
Dec 2, 2021

Conversation

AAfghahi
Copy link
Member

@AAfghahi AAfghahi commented Dec 1, 2021

SUMMARY

This PR is adding a unit test to a previous PR (#17600). I added a query_context to one of the current fixtures and exported it, making sure that there was no query context.

For importing charts, the example that we are currently using has a query context already included, and the importing does not transfer it.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #17624 (52b2db8) into master (76cd7b0) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #17624   +/-   ##
=======================================
  Coverage   68.36%   68.36%           
=======================================
  Files        1601     1601           
  Lines       65260    65263    +3     
  Branches     6963     6963           
=======================================
+ Hits        44616    44619    +3     
  Misses      18754    18754           
  Partials     1890     1890           
Flag Coverage Δ
mysql 81.80% <ø> (+<0.01%) ⬆️
postgres 81.81% <ø> (+<0.01%) ⬆️
python 81.89% <ø> (+<0.01%) ⬆️
sqlite 81.49% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/datasets/schemas.py 96.61% <0.00%> (+0.08%) ⬆️

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 76cd7b0...52b2db8. Read the comment docs.

@patch("superset.security.manager.g")
@pytest.mark.usefixtures("load_energy_table_with_slice")
def test_export_chart_with_query_context(self, mock_g):
"""Test that charts that have a query_context are imported correctly"""
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"""Test that charts that have a query_context are imported correctly"""
"""Test that charts that have a query_context are exported correctly"""

@betodealmeida betodealmeida merged commit b13d953 into apache:master Dec 2, 2021
@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/M 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants