Skip to content

df.show max_width does not work without manually setting the format option as well #4147

@universalmind303

Description

@universalmind303

Describe the bug

see below.

To Reproduce

# %%
import daft
from daft.dataframe.preview import PreviewColumn

long_df = daft.from_pydict({
    "strings": ["this is a really long string that is going to be truncated"],
})

long_df.show()
# ╭────────────────────────────────╮
# │ strings                        │
# │ ---                            │
# │ Utf8                           │
# ╞════════════════════════════════╡
# │ this is a really long string … │
# ╰────────────────────────────────╯
# (Showing first 1 of 1 rows)

# %%
# lets try to set the max
long_df.show(max_width=1000)
# ╭────────────────────────────────╮
# │ strings                        │
# │ ---                            │
# │ Utf8                           │
# ╞════════════════════════════════╡
# │ this is a really long string … │
# ╰────────────────────────────────╯
# (Showing first 1 of 1 rows)
# %%
# hmm maybe we need to set it for the individual column. 
long_df.show(columns=[PreviewColumn(max_width=1000)])
# ╭────────────────────────────────╮
# │ strings                        │
# │ ---                            │
# │ Utf8                           │
# ╞════════════════════════════════╡
# │ this is a really long string … │
# ╰────────────────────────────────╯
# (Showing first 1 of 1 rows)

# %%
# i guess you also need to set the `format` for it to work? 
long_df.show(format="fancy", max_width=1000)
# ╭────────────────────────────────────────────────────────────╮
# │ strings                                                    │
# ╞════════════════════════════════════════════════════════════╡
# │ this is a really long string that is going to be truncated │
# ╰────────────────────────────────────────────────────────────╯
# (Showing first 1 of 1 rows)

Expected behavior

No response

Component(s)

Expressions

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededp2 (backlog)Nice to have features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions