-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
ENH:Add EA types to read CSV #23255
ENH:Add EA types to read CSV #23255
Conversation
Hello @kprestel! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on January 02, 2019 at 02:01 Hours UTC |
Where exactly in the chain of pandas' normal parse, infer, astype, chain does this fall? Is it at the very end? This seems fragile... Consider a person writing a |
If we want to support this in general for EAs, I think we need to add a new method to the interface to parse from strings. |
see #23595 maybe |
@TomAugspurger I'm nowhere near an expert in pandas but from what I can tell the casting happens at the very end. The infer/astype chain seems to start in @jorisvandenbossche Are you suggesting that we add something like @jreback Can you explain a little bit more about how to create a new test module? I'm not exactly sure what pattern to follow. I'm guessing I need to create a test class and inherit from some base test class but I can't figure out which. Just putting my test in the new Thanks everyone for their feedback! |
As a quick bit of debugging, you could drop a We should also think about this in the context of #20612. There will be common patterns for every type of IO we want to add support for (no concrete suggestions right now though). |
I think whatever this change ends up being it will close #20612. In the original issue (#23228), it is noted that Basically when you pass a EA to the It seems like that needs to be fixed before anything. |
d6a09e5
to
22f2fa1
Compare
@kprestel pls merge master. |
db9af0e
to
69226de
Compare
69226de
to
5b53438
Compare
Codecov Report
@@ Coverage Diff @@
## master #23255 +/- ##
==========================================
+ Coverage 42.46% 42.46% +<.01%
==========================================
Files 161 161
Lines 51557 51592 +35
==========================================
+ Hits 21892 21908 +16
- Misses 29665 29684 +19
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #23255 +/- ##
==========================================
+ Coverage 92.3% 92.32% +0.01%
==========================================
Files 166 166
Lines 52412 52454 +42
==========================================
+ Hits 48381 48430 +49
+ Misses 4031 4024 -7
Continue to review full report at Codecov.
|
can you merge master |
856753c
to
4fb55b5
Compare
@jreback Done. Sorry about the delay. |
4fb55b5
to
b1aaa36
Compare
I think the implementation works and is ready for a full review. I may need a bit of guidance on the testing part though. I've tested it locally and it works but I'm not sure how to test it "more generally" following existing patterns. Any guidance on that aspect would be greatly appreciated. Thanks for all the help/time given to me so far! |
b1aaa36
to
2c3d27a
Compare
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.
you are having WAY too many catching of dtypes. Rip all of that out and just leave the code in parser.pyx
@jreback You're right and not 20 minutes after I pushed it did I think about that... I was too focused on the use case you described in the original issue, however if I just rip out everything that isn't in I will reply to your comments and answer your questions. Thanks for the review. I really appreciate it. |
@kprestel for > #23255 (comment) right, the python parser will need some small fixes as well. but let's start minimally. |
e8db3d2
to
4937b22
Compare
@kprestel no, thank you! this is a really useful feature! actually now that I think about it. Can you add an example in io.rst (and maybe in the read_csv doc-string) showing say reading in as Int64 (I think we already have an example, so you can just add another column that is Int64), actually maybe add reading as decimal would be cool too. |
@jreback Done. Let me know if that isn't what you were looking for. |
perfect |
ping on green. |
Seems like this needs to get updated or removed? This works now I think... 2018-12-30T20:24:59.3212208Z Check for invalid EA testing Otherwise it should be fine now. |
@kprestel that's a hint to use: self.assert_frame_equal |
@jreback should be good after this build. Sorry for the delay. |
thanks @kprestel we have pretty strict ci / linters now-a-days; a good thing. |
thanks @kprestel really nice! |
keep em coming! |
I plan on it. Thanks again for the help! |
Follow-up to pandas-devgh-23255.
Closes GH23228
git diff upstream/master -u -- "*.py" | flake8 --diff