Skip to content

PD.DataFrame is not supported for State #279

@qu3vipon

Description

@qu3vipon

Describe the bug
pd.DataFrame type is not supported for State

To Reproduce

class State(pc.State):
   data: pd.DataFrame

Error Message

$ TypeError: State vars must be primitive Python types, Plotly figures, Pandas dataframes, or subclasses of pc.Base. Found var “data” with type <class ‘pandas.core.frame.DataFrame’>.

Code

  • couldn’t find pd.DataFrame in Valid state var types
# pynecone/utils.py L60

# Valid state var types
PrimitiveType = Union[int, float, bool, str, list, dict, tuple]
StateVar = Union[PrimitiveType, Base, None]

Specifics (please complete the following information):

  • Python Version: 3.8.10
  • Pynecone Version: 0.1.12
  • OS: mac OS

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions