cj-zhukov opened a new pull request, #24234: URL: https://github.com/apache/datafusion/pull/24234
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #https://github.com/apache/datafusion/issues/24232. ## Rationale for this change The `dataframe!` macro supports most primitive numeric types but was missing `f16` support. This change addresses the existing `TODO` and adds support for `f16` values. <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the implementation. "COUNT(DISTINCT) returns wrong results when the column contains nulls" is the user-visible problem. --> ## What changes are included in this PR? - Add `IntoArrayRef` implementations for `half::f16`: - `Vec<half::f16>` - `Vec<Option<half::f16>>` - `&[half::f16]` - `&[Option<half::f16>]` - Improve `test_dataframe_macro` to cover all supported primitive types and the different input forms supported by the macro. - Improve `test_dataframe_from_columns` to cover the supported Arrow data types, including `Float16`. - No breaking changes. <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? Yes. The existing `test_dataframe_macro` and `test_dataframe_from_columns` tests have been extended to verify the expected data types and resulting dataframe contents. <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? Yes. The `dataframe!` macro now supports `f16` values. <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
