-
Notifications
You must be signed in to change notification settings - Fork 130
adding dshape parameter to CSV #476
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
Open
ywang007
wants to merge
8
commits into
blaze:master
Choose a base branch
from
ywang007:issue461
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
790d3f2
adding dshape parameter to CSV
99c351b
remove dup file
d153193
compare measure
8c7c03e
test
e9c9db0
fix test
f2a79bc
change dshape parameter to CSV to user_dshape to avoid conflicts
aff0daa
typo
19b683f
unwind not needed change
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -398,6 +398,17 @@ def test_discover_with_dotted_names(): | |
| assert dshape == datashape.dshape('var * {"a.b": int64, "c.d": int64}') | ||
| assert dshape.measure.names == [u'a.b', u'c.d'] | ||
|
|
||
| def test_discover_csv_with_fixed_dshape(): | ||
| with filetext('name,val\nAlice,1\n,0\nBob,2') as fn: | ||
| ds = datashape.dshape('var * {name: string, val: float64}') | ||
| csv1 = CSV(fn, user_dshape=ds) | ||
| ds1 = discover(csv1) | ||
| assert ds1 == ds | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a test that verifies that the passed-in datashape overrides the datashape when it isn't passed in. Perhaps a CSV file like: And an overridden dshape like |
||
| csv2 = CSV(fn, has_header=True) | ||
| ds2 = discover(csv2) | ||
| assert ds1 != ds2 | ||
|
|
||
|
|
||
|
|
||
| try: | ||
| unichr | ||
|
|
||
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.
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.
Perhaps we could add an
ensure_consistent_dshapedefault arg (defaultFalse); if set toTrue, then thec._dshapewould be tested against the dshape of thedfloaded below to ensure the user-specified dshape is compatible with the discovered dshape.