Skip to content
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

Some more inconsistency between can_cast_types and cast_with_options #3250

Closed
viirya opened this issue Dec 1, 2022 · 1 comment · Fixed by #3238
Closed

Some more inconsistency between can_cast_types and cast_with_options #3250

viirya opened this issue Dec 1, 2022 · 1 comment · Fixed by #3238
Labels
arrow Changes to the arrow crate bug

Comments

@viirya
Copy link
Member

viirya commented Dec 1, 2022

Describe the bug

There are more inconsistency between can_cast_types and cast_with_options that is cast_with_options can cast but can_cast_types reports false.

For example,

  1. Casting from Dictionary of Integer to DecimalArray
thread 'test_can_cast_types' panicked at 'Was able to cast array DictionaryArray {keys: PrimitiveArray<Int8>
[
  0,
  1,
] values: PrimitiveArray<Int32>
[
  1,
  2,
]}
 from Dictionary(Int8, Int32) to Decimal128(38, 0) but can_cast_types reported false', arrow/tests/array_cast.rs:83:21
  1. Casting from List of some type (e.g., Integer) to Dictionary of Utf8
thread 'test_can_cast_types' panicked at 'Was not able to cast array ListArray
[
  PrimitiveArray<Int32>
[
  0,
  1,
  2,
],
  PrimitiveArray<Int32>
[
  3,
  4,
  5,
],
  PrimitiveArray<Int32>
[
  6,
  7,
],
] from List(Field { name: "item", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) to Dictionary(Int16, Utf8) but can_cast_types reported true. Error was CastError("Cannot cast list to non-list data types")', arrow/tests/array_cast.rs:87:21

To Reproduce

Expected behavior

Additional context

@alamb
Copy link
Contributor

alamb commented Dec 9, 2022

label_issue.py automatically added labels {'arrow'} from #3238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants