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: bump celery and Flask #19168

Merged
merged 21 commits into from
Mar 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed test
dpgaspar committed Mar 16, 2022

Verified

This commit was signed with the committer’s verified signature.
EasterTheBunny Awbrey Hughlett
commit 95194ac277bb795f672665de90f6676162aeba43
2 changes: 1 addition & 1 deletion tests/integration_tests/dashboards/api_tests.py
Original file line number Diff line number Diff line change
@@ -1343,7 +1343,7 @@ def test_export(self):
dashboards_ids = get_dashboards_ids(db, ["world_health", "births"])
uri = f"api/v1/dashboard/export/?q={prison.dumps(dashboards_ids)}"

rv = self.client.get(uri)
rv = self.get_assert_metric(uri, "export")
headers = generate_download_headers("json")["Content-Disposition"]

assert rv.status_code == 200
59 changes: 30 additions & 29 deletions tests/integration_tests/sqllab_tests.py
Original file line number Diff line number Diff line change
@@ -152,35 +152,36 @@ def test_sql_json_dml_disallowed(self):
]
}

# @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
# def test_sql_json_to_saved_query_info(self):
# """
# SQLLab: Test SQLLab query execution info propagation to saved queries
# """
# from freezegun import freeze_time
#
# self.login("admin")
#
# sql_statement = "SELECT * FROM birth_names LIMIT 10"
# examples_db_id = get_example_database().id
# saved_query = SavedQuery(db_id=examples_db_id, sql=sql_statement)
# db.session.add(saved_query)
# db.session.commit()
#
# with freeze_time("2020-01-01T00:00:00Z"):
# self.run_sql(sql_statement, "1")
# saved_query_ = (
# db.session.query(SavedQuery)
# .filter(
# SavedQuery.db_id == examples_db_id, SavedQuery.sql == sql_statement
# )
# .one_or_none()
# )
# assert saved_query_.rows is not None
# assert saved_query_.last_run == datetime.now()
# # Rollback changes
# db.session.delete(saved_query_)
# db.session.commit()
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_sql_json_to_saved_query_info(self):
"""
SQLLab: Test SQLLab query execution info propagation to saved queries
"""
from freezegun import freeze_time

self.login("admin")

sql_statement = "SELECT * FROM birth_names LIMIT 10"
examples_db_id = get_example_database().id
saved_query = SavedQuery(db_id=examples_db_id, sql=sql_statement)
db.session.add(saved_query)
db.session.commit()

current_time = datetime.now()
with freeze_time(current_time):
self.run_sql(sql_statement, "1")
saved_query_ = (
db.session.query(SavedQuery)
.filter(
SavedQuery.db_id == examples_db_id, SavedQuery.sql == sql_statement
)
.one_or_none()
)
assert saved_query_.rows is not None
assert saved_query_.last_run == current_time
# Rollback changes
db.session.delete(saved_query_)
db.session.commit()

@parameterized.expand([CtasMethod.TABLE, CtasMethod.VIEW])
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")