Skip to content

Commit

Permalink
create empty with pl
Browse files Browse the repository at this point in the history
Signed-off-by: Alp Aribal <[email protected]>
  • Loading branch information
AlpAribal committed Aug 26, 2024
1 parent 13bb3ce commit 9981ee0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandera/api/polars/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def to_json_schema(cls):
FastAPI integration.
"""
schema = cls.to_schema()
empty = pd.DataFrame(columns=schema.columns.keys()).astype(
{k: v.type for k, v in schema.dtypes.items()}
)
empty = pl.DataFrame(

Check warning on line 125 in pandera/api/polars/model.py

View check run for this annotation

Codecov / codecov/patch

pandera/api/polars/model.py#L125

Added line #L125 was not covered by tests
schema={k: v.type for k, v in schema.dtypes.items()}
).to_pandas()
table_schema = pd.io.json.build_table_schema(empty)

def _field_json_schema(field):
Expand Down

0 comments on commit 9981ee0

Please sign in to comment.