Skip to content

Commit 208fd24

Browse files
committed
Including suggested changes to function_internal.h
1 parent 47e3e8c commit 208fd24

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cpp/src/arrow/compute/function_internal.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static inline Result<std::shared_ptr<Scalar>> GenericToScalar(
347347
static inline Result<std::shared_ptr<Scalar>> GenericToScalar(
348348
const std::shared_ptr<DataType>& value) {
349349
if (!value) {
350-
return Status::Invalid("shared_ptr<DataType> is nullptr");
350+
return std::make_shared<NullScalar>();
351351
}
352352
return MakeNullScalar(value);
353353
}
@@ -448,6 +448,9 @@ static inline enable_if_same_result<T, SortKey> GenericFromScalar(
448448
template <typename T>
449449
static inline enable_if_same_result<T, std::shared_ptr<DataType>> GenericFromScalar(
450450
const std::shared_ptr<Scalar>& value) {
451+
if (value->type->id() == Type::NA) {
452+
return std::shared_ptr<NullType>();
453+
}
451454
return value->type;
452455
}
453456

python/pyarrow/tests/test_compute.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ def test_option_class_equality(request):
202202
pc.WeekOptions(week_starts_monday=True, count_from_zero=False,
203203
first_week_is_fully_in_year=False),
204204
pc.ZeroFillOptions(4, "0"),
205-
pc.InversePermutationOptions(output_type=pa.int32()),
206205
]
207206
# Timezone database might not be installed on Windows or Emscripten
208207
if request.config.pyarrow.is_enabled["timezone_data"]:

0 commit comments

Comments
 (0)