We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
format_rows
get_card_data
1 parent 627b53a commit b673acdCopy full SHA for b673acd
1 file changed
tests/test_metabase_api.py
@@ -251,11 +251,22 @@ def test_search(self):
251
def test_get_card_data(self):
252
# json
253
res = mb.get_card_data(card_id=1)
254
+ json_data = [
255
+ {'col1': 'row1 cell1', 'col2': 1},
256
+ {'col1': None, 'col2': 2},
257
+ {'col1': 'row3 cell1', 'col2': None},
258
+ {'col1': None, 'col2': None},
259
+ {'col1': 'row5 cell1', 'col2': 5}
260
+ ]
261
+ self.assertEqual(res, json_data)
262
+
263
+ # formatted rows (in json export mode, None become '' and numbers become strings, e.g. 123 -> '123')
264
+ res = mb.get_card_data(card_id=1, format_rows=True)
265
json_data = [
266
{'col1': 'row1 cell1', 'col2': '1'},
267
{'col1': '', 'col2': '2'},
- {'col1': 'row3 cell1', 'col2': None},
- {'col1': '', 'col2': None},
268
+ {'col1': 'row3 cell1', 'col2': ''},
269
+ {'col1': '', 'col2': ''},
270
{'col1': 'row5 cell1', 'col2': '5'}
271
]
272
self.assertEqual(res, json_data)
0 commit comments