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

Arrow - nested types #349

Closed
hjrnunes opened this issue Mar 20, 2023 · 0 comments · Fixed by #351
Closed

Arrow - nested types #349

hjrnunes opened this issue Mar 20, 2023 · 0 comments · Fixed by #351

Comments

@hjrnunes
Copy link

hjrnunes commented Mar 20, 2023

Seems TMD doesn't like Arrow nested types.

Consider the following example with List using Pandas:

import pandas as pd
import pyarrow.feather as ft

df_list = pd.DataFrame({'idx': [0, 1, 2],
                        'class-name': [['dog', 'car'], ['dog', 'flower'], ['car', 'flower']],
                        'confidence': [[0.8, 0.3], [0.75, 0.85], [0.46, 0.84]],
                        })

df_list.to_feather("arrow_list.arrow")

Loading arrow_list.arrow with TMD results in:

|                                                                           :$error |         :$value |
|-----------------------------------------------------------------------------------|-----------------|
| Failed to datafy datatype class org.apache.arrow.vector.types.pojo.ArrowType$List | arrow_img.arrow |

Extending Datafy to ArrowType$List further results in:

Execution error (AssertionError) at tech.v3.libs.arrow/records->ds (arrow.clj:1351).
Assert failed: (= (count fields) (count nodes))

So Field.children are not taken into account when reading the schema with tech.v3.libs.arrow/read-schema and the assertion fails because it'll then have, in this case, 5 nodes for 3 fields only.

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

Successfully merging a pull request may close this issue.

1 participant