-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH:Add EA types to read CSV #23255
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
Merged
Merged
ENH:Add EA types to read CSV #23255
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c4e0058
ENH:Add EA types to read CSV
kprestel 744d450
Address merge comments
kprestel 8368d19
WIP:Make python engine support EA types when reading CSVs
kprestel fc9ba8e
Fix CI
kprestel 1d9ee65
Formatting
kprestel d98ce71
Make C engine the same as python parser engine
kprestel 7b50b2c
Merging master
kprestel 662e037
Update whatsnew
kprestel 41f2b4e
Fix low_memory C engine parser
kprestel d118921
Address merge comments
kprestel b2dd5e4
Require EAs to implement _from_sequence_of_strings to be used in parsers
kprestel f1f5aaa
pep8
kprestel b96da9d
Address merge comments
kprestel 50ca0c3
Do EA type inference in the parser method rather than the cast method
kprestel ecf2653
Fix imports using isort
kprestel 5cce856
Correct tests to match existing patterns, address merge comments
kprestel 4de830c
Addressing more merge comments
kprestel f908e2e
Update docs to show using Int64 dtype
kprestel e60549c
Update docs per comments in PR
kprestel a6a2d99
Fix linters
kprestel 053b442
Fix linters again
kprestel f42235a
isort
kprestel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from pandas.compat import StringIO | ||
|
||
import pandas as pd | ||
|
||
from .base import BaseExtensionTests | ||
|
||
|
||
class BaseParsingTests(BaseExtensionTests): | ||
|
||
@pytest.mark.parametrize('engine', ['c', 'python']) | ||
def test_EA_types(self, engine, data): | ||
df = pd.DataFrame({ | ||
'with_dtype': pd.Series(data, dtype=str(data.dtype)) | ||
}) | ||
csv_output = df.to_csv(index=False, na_rep=np.nan) | ||
result = pd.read_csv(StringIO(csv_output), dtype={ | ||
'with_dtype': str(data.dtype) | ||
}, engine=engine) | ||
expected = df | ||
self.assert_frame_equal(result, expected) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.