Skip to content

Commit

Permalink
Fixed type hint and format function call
Browse files Browse the repository at this point in the history
  • Loading branch information
SarthakNikhal committed Apr 29, 2024
1 parent 1c1f29f commit 5e75e74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion solara/components/datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def DataTable(
dfs = df_slice(df, i1, i2)
records = df_records(dfs)
for i in range(i2 - i1):
item = {"__row__": format(rows[i + i1])} # special key for the row number
item = {"__row__": format(dfs, columns, i + 1, rows[i + i1])} # special key for the row number
for column in columns:
item[column] = format(dfs, column, i + i1, records[i][column])
items.append(item)
Expand Down
2 changes: 1 addition & 1 deletion solara/lab/utils/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def df_columns(df) -> List[str]:
else:
raise TypeError(f"{type(df)} not supported")

def df_row_names(df) -> List[any]:
def df_row_names(df) -> List[Union[int, str]]:
"""Return a list of row names from a dataframe."""
if df_type(df) == "vaex" or df_type(df) == "polars":
return list(range(df_len(df)))
Expand Down

0 comments on commit 5e75e74

Please sign in to comment.