You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2021/05/24 14:53:00 UTC
[jira] [Comment Edited] (ARROW-12859) [C++] Add DatumFromJSON for
easier testing
[ https://issues.apache.org/jira/browse/ARROW-12859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17350468#comment-17350468 ]
David Li edited comment on ARROW-12859 at 5/24/21, 2:52 PM:
------------------------------------------------------------
Ah, I had only been thinking about primitives…we could either make it {{PrimitiveDatumFromJSON}} or just cancel this (tests could also just define an {{AssertFoo(Datum ...)}} and then use {{ScalarFromJSON}} or {{ArrayFromJSON}} as appropriate - would be more verbose but would at least avoid having to define lots of overloads). Or we could define very simple wrappers ({{DatumFromJSON(int64(), Scalar("[1]")}}) which could become C++14 user-defined literals ({{DatumFromJSON(int64(), "[1]"_scalar}}). (Though, on second thought, the literal syntax doesn't really buy us anything here so there's no point there.)
was (Author: lidavidm):
Ah, I had only been thinking about primitives…we could either make it {{PrimitiveDatumFromJSON}} or just cancel this (tests could also just define an {{AssertFoo(Datum ...)}} and then use {{ScalarFromJSON}} or {{ArrayFromJSON}} as appropriate - would be more verbose but would at least avoid having to define lots of overloads). Or we could define very simple wrappers ({{DatumFromJSON(int64(), Scalar("[1]")}}) which could become C++14 user-defined literals ({{DatumFromJSON(int64(), "[1]"_scalar}}).
> [C++] Add DatumFromJSON for easier testing
> ------------------------------------------
>
> Key: ARROW-12859
> URL: https://issues.apache.org/jira/browse/ARROW-12859
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Reporter: David Li
> Assignee: David Li
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> For kernels that accept/return permutations of array/scalar arguments, having a single DatumFromJSON would make things much easier to test (as then we can have helper test methods that just take {{const std::string&}} instead of having to make many overloads for the various input/output permutations).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)