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

Don't truncate UUID columns #3346

Closed
robsmith11 opened this issue Jun 24, 2023 · 3 comments · Fixed by #3347
Closed

Don't truncate UUID columns #3346

robsmith11 opened this issue Jun 24, 2023 · 3 comments · Fixed by #3347
Assignees
Labels
Milestone

Comments

@robsmith11
Copy link

I think it's fairly common to work with UUID columns when analyzing tabular data, so it would be nice if printing a DataFrame would show the entire UUID rather than truncating the last few characters by default:

julia> DataFrame(u=[UUIDs.uuid4() for _ in 1:5])
5×1 DataFrame
 Row │ u
     │ Base.UUID
─────┼───────────────────────────────────
   1 │ c3a41e1a-1a33-42b0-bba6-4712e7a0…
   2 │ 63825c87-db1a-4942-a18c-65167cf9…
   3 │ bcfc3f6e-182d-4457-a5e8-38a7c375…
   4 │ 398e1253-746a-4314-b33d-0de4a90e…
   5 │ 0f4b8749-e8e6-4dd7-b6d0-90836c2f…
@bkamins bkamins added this to the 1.6 milestone Jun 24, 2023
@bkamins
Copy link
Member

bkamins commented Jun 24, 2023

@ronisbr - do you think it is possible to display whole column if it has UUID eltype? (i.e. to adjust maximum coumn width depending on its eltype?)

@ronisbr
Copy link
Member

ronisbr commented Jun 24, 2023

Hi @bkamins and @robsmith11 !

Yes, it should be very easy, I will do a PR now.

@ronisbr
Copy link
Member

ronisbr commented Jun 24, 2023

Seems to be working:

julia> df = DataFrame(a = 1:10, uuid = [i % 2 == 0 ? missing : Base.UUID.(rand(UInt128)) for i in 1:10])
10×2 DataFrame
 Row │ a      uuid
     │ Int64  Base.UUID?
─────┼─────────────────────────────────────────────
   11  b0be25f7-1fa8-db3d-7624-293df963fe31
   22  missing
   33  20ea39d0-e188-ee29-d3b7-2200acf3a201
   44  missing
   55  18beb68e-9e2e-70f3-ab08-39b86859a8e3
   66  missing
   77  66cbd1b2-d72a-2d29-c3ae-127aa75db946
   88  missing
   99  1224fbcc-a008-b9b7-bb16-9034091b5cf2
  1010  missing

I will just add a test now.

ronisbr pushed a commit to ronisbr/DataFrames.jl that referenced this issue Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants