(df, n)
| 378 | |
| 379 | |
| 380 | def safe_head(df, n): |
| 381 | r = M.head(df, n) |
| 382 | if len(r) != n: |
| 383 | warnings.warn( |
| 384 | f"Insufficient elements for `head`. {n} elements requested, only {len(r)} " |
| 385 | "elements available. Try passing larger `npartitions` to `head`." |
| 386 | ) |
| 387 | return r |
| 388 | |
| 389 | |
| 390 | def _repr_data_series(s, index): |