()
| 173 | |
| 174 | |
| 175 | def test_df_to_html(): |
| 176 | pytest.importorskip("jinja2") |
| 177 | df = pd.DataFrame({"col1": range(10), "col2": map(float, range(10))}) |
| 178 | ddf = from_pandas(df, 3) |
| 179 | |
| 180 | exp = dedent( |
| 181 | """\ |
| 182 | <div><strong>Dask DataFrame Structure:</strong></div> |
| 183 | <table border="1" class="dataframe"> |
| 184 | <thead> |
| 185 | <tr style="text-align: right;"> |
| 186 | <th></th> |
| 187 | <th>col1</th> |
| 188 | <th>col2</th> |
| 189 | </tr> |
| 190 | <tr> |
| 191 | <th>npartitions=3</th> |
| 192 | <th></th> |
| 193 | <th></th> |
| 194 | </tr> |
| 195 | </thead> |
| 196 | <tbody> |
| 197 | <tr> |
| 198 | <th>0</th> |
| 199 | <td>int64</td> |
| 200 | <td>float64</td> |
| 201 | </tr> |
| 202 | <tr> |
| 203 | <th>4</th> |
| 204 | <td>...</td> |
| 205 | <td>...</td> |
| 206 | </tr> |
| 207 | <tr> |
| 208 | <th>7</th> |
| 209 | <td>...</td> |
| 210 | <td>...</td> |
| 211 | </tr> |
| 212 | <tr> |
| 213 | <th>9</th> |
| 214 | <td>...</td> |
| 215 | <td>...</td> |
| 216 | </tr> |
| 217 | </tbody> |
| 218 | </table> |
| 219 | <div>Dask Name: frompandas, 1 expression</div>""" |
| 220 | ) |
| 221 | assert ddf.to_html() == exp |
| 222 | assert ddf._repr_html_() == exp # for jupyter |
nothing calls this directly
no test coverage detected