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

fix: python schema repr does not truncate output #628

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

danepitkin
Copy link
Member

@danepitkin danepitkin commented Sep 20, 2024

Fix #466

>>> import nanoarrow as na
>>> url = "https://github.com/apache/arrow-experiments/raw/main/data/arrow-commits/arrow-commits.arrows"
>>> schema = na.ArrayStream.from_url(url).schema
>>> schema
<Schema> non-nullable struct<commit: string, time: timestamp('us', 'UTC'), files: int32, merge: bool, message: string>

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I do think there's a point where printing out everything is more harmful than helpful (e.g., if there are thousands of columns); however, this is a substantial improvement over what is here now!

@paleolimbot paleolimbot merged commit 503548b into apache:main Sep 20, 2024
11 checks passed
@danepitkin
Copy link
Member Author

Thanks for the review! I suppose we could have a really high limit like 1000 chars in that case. Although, if a user prints out a schema, I assume they are in some sort of interactive or debug mode? In that use case, it might not make sense to limit the schema column output at all. 🤷

@paleolimbot paleolimbot modified the milestone: nanoarrow 0.6.0 Sep 27, 2024
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 this pull request may close these issues.

python: Schema repr should not get truncated
3 participants