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

fix: flacky test in test_update_dataset_item_w_override_columns #14082

Merged
Merged
Changes from all commits
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
25 changes: 12 additions & 13 deletions tests/datasets/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,16 +582,15 @@ def test_update_dataset_item_w_override_columns(self):
# Add default dataset
dataset = self.insert_default_dataset()
self.login(username="admin")
new_col_dict = {
"column_name": "new_col",
"description": "description",
"expression": "expression",
"type": "INTEGER",
"verbose_name": "New Col",
}
dataset_data = {
"columns": [
{
"column_name": "new_col",
"description": "description",
"expression": "expression",
"type": "INTEGER",
"verbose_name": "New Col",
}
],
"columns": [new_col_dict],
"description": "changed description",
}
uri = f"api/v1/dataset/{dataset.id}?override_columns=true"
Expand All @@ -600,10 +599,10 @@ def test_update_dataset_item_w_override_columns(self):

columns = db.session.query(TableColumn).filter_by(table_id=dataset.id).all()

assert columns[0].column_name == dataset_data["columns"][0]["column_name"]
assert columns[0].description == dataset_data["columns"][0]["description"]
assert columns[0].expression == dataset_data["columns"][0]["expression"]
assert columns[0].type == dataset_data["columns"][0]["type"]
assert new_col_dict["column_name"] in [col.column_name for col in columns]
assert new_col_dict["description"] in [col.description for col in columns]
assert new_col_dict["expression"] in [col.expression for col in columns]
assert new_col_dict["type"] in [col.type for col in columns]

db.session.delete(dataset)
db.session.commit()
Expand Down