Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix to_json when converting Period column #32665

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/io/json/_table_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def convert_pandas_type_to_json_field(arr, dtype=None):
field["constraints"] = {"enum": list(cats)}
field["ordered"] = ordered
elif is_period_dtype(arr):
field["freq"] = arr.freqstr
field["freq"] = arr.dtype.freq.freqstr
elif is_datetime64tz_dtype(arr):
if hasattr(arr, "dt"):
field["tz"] = arr.dt.tz.zone
Expand Down