-
-
Notifications
You must be signed in to change notification settings - Fork 141
feat: add table
to JsonSeriesOrient Literals
#482
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
Conversation
@@ -318,7 +318,7 @@ MergeHow: TypeAlias = Union[JoinHow, Literal["cross"]] | |||
JsonFrameOrient: TypeAlias = Literal[ | |||
"split", "records", "index", "columns", "values", "table" | |||
] | |||
JsonSeriesOrient: TypeAlias = Literal["split", "records", "index"] | |||
JsonSeriesOrient: TypeAlias = Literal["split", "records", "index", "table"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seem to be a few more orientation values https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_json.html that can be added.
Ideally, we would also have a test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test that tests all the possible arguments for the orient
argument? Modify the function test_json_series()
in test_io.py
.
Commit A more general question - can we not import types from pandas-stubs directly? With |
tests/test_io.py
Outdated
@@ -387,12 +387,39 @@ def test_json(): | |||
check(assert_type(read_json(bin_json), DataFrame), DataFrame) | |||
|
|||
|
|||
def test_json_series(): | |||
def test_json_series(orient): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the orient
argument of test_json_series
unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @DarioHett
Includes the Literal
table
for theorient
argument in s.to_json().