Skip to content

Commit 5a7d27a

Browse files
committed
Update tests to use new index name logic
Signed-off-by: Itay Dafna <[email protected]>
1 parent 055a4f2 commit 5a7d27a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_datagrid.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def datagrid(dataframe) -> None:
1818

1919
@pytest.fixture
2020
def data_object(dataframe) -> None:
21-
return DataGrid.generate_data_object(dataframe, "ipydguuid")
21+
return DataGrid.generate_data_object(dataframe, "ipydguuid", "key")
2222

2323

2424
@pytest.mark.parametrize("clear", [True, False])
@@ -115,26 +115,26 @@ def test_get_cell_value_by_numerical_index(
115115

116116

117117
def test_data_object_generation(dataframe: pd.DataFrame) -> None:
118-
data_object = DataGrid.generate_data_object(dataframe, "ipydguuid")
118+
data_object = DataGrid.generate_data_object(dataframe, "ipydguuid", "key")
119119
expected_output = {
120120
"data": [
121-
{"id": "One", "A": 1, "B": 4, "ipydguuid": 0},
122-
{"id": "Two", "A": 2, "B": 5, "ipydguuid": 1},
123-
{"id": "Three", "A": 3, "B": 6, "ipydguuid": 2},
121+
{"key": "One", "A": 1, "B": 4, "ipydguuid": 0},
122+
{"key": "Two", "A": 2, "B": 5, "ipydguuid": 1},
123+
{"key": "Three", "A": 3, "B": 6, "ipydguuid": 2},
124124
],
125125
"schema": {
126126
"fields": [
127-
{"name": "id", "type": "string"},
127+
{"name": "key", "type": "string"},
128128
{"name": "A", "type": "integer"},
129129
{"name": "B", "type": "integer"},
130130
{"name": "ipydguuid", "type": "integer"},
131131
],
132-
"primaryKey": ["id", "ipydguuid"],
132+
"primaryKey": ["key", "ipydguuid"],
133133
"pandas_version": "0.20.0",
134134
"primaryKeyUuid": "ipydguuid",
135135
},
136136
"fields": [
137-
{"id": None},
137+
{"key": None},
138138
{"A": None},
139139
{"B": None},
140140
{"ipydguuid": None},

0 commit comments

Comments
 (0)