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