-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix: Replace std::floating_point concept with std::is_floating_point_v for Apple Clang 14.0.0 compatibility #49182
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
Fix: Replace std::floating_point concept with std::is_floating_point_v for Apple Clang 14.0.0 compatibility #49182
Conversation
…able function - Add errors parameter to cast() function with 'raise' (default) and 'coerce' options - errors='coerce' converts invalid values to null instead of raising errors - Add errors parameter to Array.cast(), Scalar.cast(), and ChunkedArray.cast() instance methods - Verify is_castable() function is properly exposed and working - Add comprehensive tests including the exact example from issue apache#48972 - Update documentation with examples showing errors='coerce' usage This addresses issue apache#48972 by providing pandas.to_numeric(errors='coerce') equivalent functionality in PyArrow.
…ma is provided When reading JSON with explicit schema, the parser now attempts to convert values to match the schema type before erroring. This allows JSON files with inconsistent types (e.g., number and string for the same field) to be read successfully when an explicit schema is provided. Changes: - Store explicit_schema in HandlerBase for access during parsing - Modified AppendScalar to check for conversion before erroring - Added TryConvertAndAppend helper function to handle conversions - Updated Bool handler to also support conversion - Added tests for number->string and string->number conversions Supported conversions: - Number <-> String (when numeric) - Boolean <-> String - Boolean <-> Number - Number -> Boolean (0=false, non-zero=true) Fixes apache#49158
…v for Apple Clang 14.0.0 compatibility This fixes the CRAN build failure on macOS 13.3 with Apple Clang 14.0.0, which doesn't fully support the C++20 std::floating_point concept. The change replaces std::floating_point<T> with std::is_floating_point_v<T> in the CFloatingPointConcept definition, maintaining the same functionality while ensuring compatibility with older compilers. Fixes apache#49176
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or See also: |
|
Could you use our PR template instead of removing it entirely? |
raulcd
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.
I am going to close this PR and unassign the issue as there hasn't been a follow up. I am also seeing a trending from some users of self-assigning issues and opening PRs which are not solving the problem described in the issue. Or not only. In this case there are unrelated commits to the PR too.
This fixes the CRAN build failure on macOS 13.3 with Apple Clang 14.0.0.
The problem is that
std::floating_point<T>is a C++20 concept, but Apple Clang 14.0.0 doesn't have full support for it yet. When building, it errors out saying it can't findfloating_pointin thestdnamespace.I swapped it out for
std::is_floating_point_v<T>instead, which is basically the same thing but uses a C++17 variable template that works fine with older compilers. I also added#include <type_traits>since that's whereis_floating_point_vlives.Behavior is unchanged - still matches all the floating point types (float, double, long double) plus util::Float16. Just using a different approach that the older compiler can handle.
Fixes #49176