Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datatypes): manually cast the type of pos to int16 for table.info() #9139

Merged
merged 9 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,23 @@
assert expr.columns == list(df.columns)


@pytest.mark.notyet(
["druid"],
raises=PyDruidProgrammingError,
reason="Druid only supports trivial unions",
)
def test_table_info_large(con):
if con.name == "flink":
pytest.xfail(reason="IOException - Insufficient number of network buffers")

Check warning on line 627 in ibis/backends/tests/test_generic.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/tests/test_generic.py#L627

Added line #L627 was not covered by tests
jitingxu1 marked this conversation as resolved.
Show resolved Hide resolved

num_cols = 129
col_names = [f"col_{i}" for i in range(num_cols)]
t = ibis.memtable({col: [0, 1] for col in col_names})
result = con.execute(t.info())
assert list(result.name) == col_names
assert result.pos.dtype == np.int16


@pytest.mark.notimpl(
[
"datafusion",
Expand Down
2 changes: 1 addition & 1 deletion ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,7 @@ def info(self) -> Table:
nulls=lambda t: t.isna.sum(),
non_nulls=lambda t: (1 - t.isna).sum(),
null_frac=lambda t: t.isna.mean(),
pos=lit(pos),
pos=lit(pos, type=dt.int16),
)
aggs.append(agg)
return ibis.union(*aggs).order_by(ibis.asc("pos"))
Expand Down
Loading