Switch order of df logic. (#396)
This commit is contained in:
parent
a5bd23d792
commit
ca637801a6
@ -69,11 +69,6 @@ class DataTable(Gridjs):
|
||||
)
|
||||
|
||||
def _render(self) -> Tag:
|
||||
# If given a pandas df break up the data and columns
|
||||
if utils.is_dataframe(type(self.data)):
|
||||
self.columns = Var.create(list(self.data.columns.values.tolist())) # type: ignore
|
||||
self.data = Var.create(list(self.data.values.tolist())) # type: ignore
|
||||
|
||||
# If given a var dataframe, get the data and columns
|
||||
if isinstance(self.data, Var):
|
||||
self.columns = BaseVar(
|
||||
@ -87,5 +82,10 @@ class DataTable(Gridjs):
|
||||
state=self.data.state,
|
||||
)
|
||||
|
||||
# If given a pandas df break up the data and columns
|
||||
if utils.is_dataframe(type(self.data)):
|
||||
self.columns = Var.create(list(self.data.columns.values.tolist())) # type: ignore
|
||||
self.data = Var.create(list(self.data.values.tolist())) # type: ignore
|
||||
|
||||
# Render the table.
|
||||
return super()._render()
|
||||
|
Loading…
Reference in New Issue
Block a user