Skip to content

Commit

Permalink
chore: add changed_on_delta_humanized field on dashboard schema (apac…
Browse files Browse the repository at this point in the history
…he#15542)

* chore: add changed_on_delta_humanized field on dashboard schema

* fix ut
  • Loading branch information
zhaoyongjie authored and cccs-RyanS committed Dec 17, 2021
1 parent 17ee3ad commit 4c0be4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions superset/dashboards/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class DashboardGetResponseSchema(Schema):
owners = fields.List(fields.Nested(UserSchema))
roles = fields.List(fields.Nested(RolesSchema))
table_names = fields.String() # legacy nonsense
changed_on_humanized = fields.String(data_key="changed_on_delta_humanized")


class DatabaseSchema(Schema):
Expand Down
3 changes: 2 additions & 1 deletion tests/integration_tests/dashboards/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,10 @@ def test_get_dashboard(self):
}
data = json.loads(rv.data.decode("utf-8"))
self.assertIn("changed_on", data["result"])
self.assertIn("changed_on_delta_humanized", data["result"])
for key, value in data["result"].items():
# We can't assert timestamp values
if key != "changed_on":
if key not in ("changed_on", "changed_on_delta_humanized",):
self.assertEqual(value, expected_result[key])
# rollback changes
db.session.delete(dashboard)
Expand Down

0 comments on commit 4c0be4c

Please sign in to comment.