https://delta.io logo
r

rtyler

07/06/2023, 11:13 PM
"I know! We could use the deltalake python package for this problem!" chaos ensues
ArrowNotImplementedError: Unsupported cast from map> to map> (no available cast function for target type)
🧟
👻 1
I think this is because of a column with
map<string,array<string>>
I am kind of hoping this is fixed in
main
but I cannot test at the moment
w

Will Jones

07/06/2023, 11:17 PM
Do you have the full source and target type?
r

rtyler

07/06/2023, 11:19 PM
not sure what you mean by target type, the type that I listed comes from the
describe table
output of Spark SQL
w

Will Jones

07/06/2023, 11:21 PM
Is it basically that we can’t read a map of string to array of string?
r

rtyler

07/06/2023, 11:22 PM
that is my understanding of the error, since this is a primitive
<http://dt.to|dt.to>_pandas()
call
MUHARHARHAR, using
columns
to skip it does seem to solve the problem
@Will Jones I cannot share this data for hopefully obvious reasons, is there a good approach to provide a useful bit of data for you/others in a bug report?
w

Will Jones

07/06/2023, 11:46 PM
Are you able to get the arrow schema off the Python API? I think that’s the main hint we need
Hopefully it’s not too much more complex than that
r

rtyler

07/06/2023, 11:47 PM
I understand the words you're using but not how to translate that into code 😛 I assume you're looking for something more than
dt.schema()
The result from ☝️ is
Field(request_headers, MapType(PrimitiveType("string"), ArrayType(PrimitiveType("string"), contains_null=True), value_contains_null=True), nullable=True, metadata={'comment': 'REDACTED'})
👍 1
w

Will Jones

07/07/2023, 12:26 AM
I think there’s just one to_PyArrow you could chain on there, but what you’ve provided seems sufficient
2 Views