Skip to content

Commit

Permalink
fix table with no columns
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Mar 4, 2024
1 parent d6f3d50 commit 405f831
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
streamfy==0.2.8
streamfy==0.3.1
streamlit==1.15.2

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="streamfy",
version="0.3.0",
version="0.3.1",
author="Javier Luraschi",
author_email="[email protected]",
description="Modern frontend web components based on Buefy for Streamlit.",
Expand Down
4 changes: 2 additions & 2 deletions streamfy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def steps(**kwargs):
def table(**kwargs):
hyphened = hyphen_case_keys(kwargs)
defaults_apply("table", hyphened)
if not "columns" in hyphened:
hyphened["columns"] = [{"field": key} for key in data[0].keys()]
if not "columns" in hyphened and "data" in kwargs and len(kwargs["data"]) > 0:
hyphened["columns"] = [{"field": key} for key in kwargs["data"][0].keys()]
component_value = _component_func(component="table", **hyphened)
return component_value

Expand Down

0 comments on commit 405f831

Please sign in to comment.