Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Jul 24, 2023
1 parent 9d5195d commit 7ca02fe
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 35 deletions.
4 changes: 2 additions & 2 deletions cpp/src/arrow/type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,13 @@ Result<std::shared_ptr<DataType>> MergeTypes(std::shared_ptr<DataType> promoted_
}

if (promoted_type->id() == Type::FIXED_SIZE_LIST &&
is_var_size_list(other_type->id())) {
is_var_length_list(other_type->id())) {
promoted_type =
list(checked_cast<const BaseListType&>(*promoted_type).value_field());
promoted = other_type->Equals(*promoted_type);
}
if (other_type->id() == Type::FIXED_SIZE_LIST &&
is_var_size_list(promoted_type->id())) {
is_var_length_list(promoted_type->id())) {
other_type = list(checked_cast<const BaseListType&>(*other_type).value_field());
promoted = other_type->Equals(*promoted_type);
}
Expand Down
28 changes: 0 additions & 28 deletions cpp/src/arrow/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,6 @@ constexpr bool is_decimal(Type::type type_id) {
return false;
}


/// \brief Check for a type that can be used as a run-end in Run-End Encoded
/// arrays
///
Expand Down Expand Up @@ -1115,32 +1114,6 @@ constexpr bool is_binary(Type::type type_id) {
return false;
}

static inline bool is_string(Type::type type_id) {
switch (type_id) {
case Type::STRING:
case Type::LARGE_STRING:
return true;
default:
break;
}
return false;
}

static inline bool is_var_size_list(Type::type type_id) {
switch (type_id) {
case Type::LIST:
case Type::LARGE_LIST:
return true;
default:
break;
}
return false;
}

static inline bool is_dictionary(Type::type type_id) {
return type_id == Type::DICTIONARY;
}

/// \brief Check for a string type
///
/// \param[in] type_id the type-id to check
Expand Down Expand Up @@ -1229,7 +1202,6 @@ constexpr bool is_var_length_list(Type::type type_id) {
switch (type_id) {
case Type::LIST:
case Type::LARGE_LIST:
case Type::MAP:
return true;
default:
break;
Expand Down
1 change: 1 addition & 0 deletions python/pyarrow/table.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -5058,6 +5058,7 @@ def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None,
----
n_legs: [[2,4,5,100],[2,4]]
animals: [["Flamingo","Horse","Brittle stars","Centipede"],["Parrot","Dog"]]
"""
cdef:
vector[shared_ptr[CTable]] c_tables
Expand Down
4 changes: 1 addition & 3 deletions python/pyarrow/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,13 @@ def test_schema_merge():
result = pa.unify_schemas((a, b, c))
assert result.equals(expected)

<<<<<<< HEAD
result = pa.unify_schemas(
[b, d], options=pa.FieldMergeOptions.permissive())
assert result.equals(d)
=======

# raise proper error when passing a non-Schema value
with pytest.raises(TypeError):
pa.unify_schemas([a, 1])
>>>>>>> a9f100c690ed8608142ec3d9af043b66a41543e0


def test_undecodable_metadata():
Expand Down

0 comments on commit 7ca02fe

Please sign in to comment.