-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-1491: [C++] Add casting from strings to numbers and booleans #2362
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
Codecov Report
@@ Coverage Diff @@
## master #2362 +/- ##
==========================================
+ Coverage 84.66% 86.87% +2.21%
==========================================
Files 293 237 -56
Lines 45324 42705 -2619
==========================================
- Hits 38372 37099 -1273
+ Misses 6911 5606 -1305
+ Partials 41 0 -41
Continue to review full report at Codecov.
|
433f513 to
79cc17a
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.
I sometimes wonder what the meeting was like that decided names like 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.
I had the same thought :-)
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 we make this a little more readable by use tolower?
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.
tolower is locale-dependent.
wesm
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 for this. Made a small comment about reusing type traits but otherwise OK by me
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 could use enable_if_number<O> here from arrow/type_traits.h
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.
Done.
79cc17a to
4ce3000
Compare
|
Some weird failure occurred on the AppVeyor build that didn't occur on my AppVeyor account: |
4ce3000 to
3297aa1
Compare
|
I want to make sure the AppVeyor failure was sporadic so I've triggered another build by pushing again. |
The implementation for numbers uses the C standard strto* functions. This makes casting a bit lenient (it will accept whitespace).
3297aa1 to
c7db1b0
Compare
|
rebased |
wesm
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.
+1
The implementation for numbers uses C++
istringstream. This makes casting a bit lenient (it will probably accept whitespace).This is a rewrite of #1387