Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 157
GH:624 - added mode keyword to DataFrame.to_json#684
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
ramvikrams commented May 5, 2023 • edited by Dr-Irv
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by Dr-Irv
Uh oh!
There was an error while loading. Please reload this page.
Dr-Irv left a comment
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.
This is a bit tricky. You have to put the 2 overloads for orient = Literal["records"] first, but without the "= ..." . The first two overloads would then have lines: Literal[True] and mode: Literal["a"] . This may need an * in the right places (see DataFrame.to_dict() for an example). Then you add another pair of overloads with orient: Literal["records"] and lines: Literal[False] = ..., mode: Literal["w"] = .... Then you have the 2 overloads that are there where mode: Literal["w"] = ... is allowed.
You also have to fix the overloads in series.pyi.
For the tests, you should test the valid and invalid combinations, using TYPE_CHECKING_INVALID_USAGE for the invalid ones, with appropriate ignore statements.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ramvikrams commented May 8, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Were you trying to write |
Dr-Irv commented May 8, 2023
It may be that the second set of overloads I suggested are not needed because of the overlap you mention. |
ramvikrams commented May 10, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I have done the needfull but the only problem is with the warnings in the test, could you please help with that |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Dr-Irv left a comment
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.
2 small changes, and then it should be good to go
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Dr-Irv left a comment
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.
2 small changes, and then it should be good to go
Dr-Irv left a comment
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 @ramvikrams
assert_type()to assert the type of any return value