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

[BUG]%%pretty with chinese character error #767

Open
kongLingming06 opened this issue Aug 7, 2022 · 8 comments
Open

[BUG]%%pretty with chinese character error #767

kongLingming06 opened this issue Aug 7, 2022 · 8 comments

Comments

@kongLingming06
Copy link

Describe the bug
when use %%pretty function, if there is chinese character in the table, the table cannot show properly and return this error.

An internal error was encountered.
Please file an issue at https://github.com/jupyter-incubator/sparkmagic
Error:
Expected DF rows to be uniform width (581)

To Reproduce
%%pretty
df.show()

Versions:

  • SparkMagic
  • Livy (if you know it)
  • Spark
@xuansontrinh
Copy link

I experience the same issue.

@baixinzxl
Copy link

I experience the same issue too, when i want to display chinese character,it will return error:
Expected DF rows to be uniform width (804)

thanks to any help,it really confuses me TAT

@devstein
Copy link
Collaborator

This issue should be fixed by this PR, which I just released as part of the 0.20.4 release.

I'm marking this as resolved for now, but please let me know if this is not the case after you upgrade.

@baixinzxl
Copy link

baixinzxl commented Jan 31, 2023

This issue should be fixed by this PR, which I just released as part of the 0.20.4 release.

I'm marking this as resolved for now, but please let me know if this is not the case after you upgrade.

thanks for your reply!
but when i upgrade to 0.20.4 release,i will still meet the same probelm:
Expected DF rows to be uniform width (11)
but found | a| 你好| (9)

i found it is correct in livyserver,but returned error in notebook display

maybe you can use this dataframe to reappear the problem:
`
%%pretty

df = spark.createDataFrame([("a","你好"),("b","你好")],("key","value"))

df.show(5)
`

@devstein

and it is my versions
spark 2.4.5
sparkmagic 0.20.4
i dont know livy version

@devstein devstein reopened this Jan 31, 2023
@devstein
Copy link
Collaborator

Thanks for the code snippet @baixinzxl. I will investigate once I have bandwidth in the coming weeks. Contributions are welcome if you want to dive into the code!

@baixinzxl
Copy link

baixinzxl commented Feb 2, 2023

thanks, take your time~
and i guess the problem may relate with chinese encoding differences from livy to jupyter ,hope it helps

@baixinzxl
Copy link

sorry for disturbing but i wonder if there is any findings about the problem?
looking forward to hearing from you @devstein ~ thank you ~

@devstein
Copy link
Collaborator

devstein commented Apr 5, 2023

Hey @baixinzxl I haven't forgotten about this. I've been stretched for time and have tried to tackle this twice without success. The relevant code is in this file if you want to take a stab at it!

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

No branches or pull requests

4 participants