Skip to main content
Question

Error pivot table with utf-8 attribute

  • December 27, 2018
  • 15 replies
  • 49 views

hoa_le
Contributor
Forum|alt.badge.img+5

Hi all,

I'm making pivot table from json file but I got problem in this model.

Could you tell me why? Thank you

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

15 replies

takashi
Celebrity
  • 7843 replies
  • December 27, 2018

What problem did you get?


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • December 27, 2018

Hi @hoa_le

Thanks you workspace.

I checked that you used the transformer PythonCaller and you checked if the input information is Unicode.

In my opinion the problem is your transformer checked the information unicode and the result was inputed in the Log file:

 

If you used the transformer AttributeValidator for check if the value is Unicode?

 

Thanks,

Danilo


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • December 27, 2018

Hi @hoa_le

Thanks you workspace.

I checked that you used the transformer PythonCaller and you checked if the input information is Unicode.

In my opinion the problem is your transformer checked the information unicode and the result was inputed in the Log file:

 

If you used the transformer AttributeValidator for check if the value is Unicode?

 

Thanks,

Danilo

Hi,

Actually, I want to pivot table use to change_type column but it's utf-8 attributes. So I get error when pivot. So I want to ask how to fix it to write pivot table.


takashi
Celebrity
  • 7843 replies
  • December 27, 2018

I'm unclear what you intend to get with the AttributePivoter. Anyway, I don't think it's a character encoding issue.

If your goal was to calculate the number of features for each unique pair of province and change_type, the StatisticsCalculator would be the way to go, rather than the AttributePivoter.

Example:

Result:


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • December 27, 2018

I'm unclear what you intend to get with the AttributePivoter. Anyway, I don't think it's a character encoding issue.

If your goal was to calculate the number of features for each unique pair of province and change_type, the StatisticsCalculator would be the way to go, rather than the AttributePivoter.

Example:

Result:

Hi Takashi,

I will use pivot based on change_type in collumn. But chang_type collumn is utf-8. So when pivot I get error at the below. I attached my pivot file excel that I want to do in FME.

 


takashi
Celebrity
  • 7843 replies
  • December 27, 2018

I was able to reproduce the same Python error as yours. The AttributePivoter is a Python based transformer, and looks like it doesn't support international characters if Python interpreter version is 2.7. In order to avoid this error, you should change the Python Compatibility parameter to 3.4+ or later.

Note: Python 2.7 support would be removed from FME in the near future.

Probably this workflow generates a result closer to your desired one.


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • December 28, 2018

I was able to reproduce the same Python error as yours. The AttributePivoter is a Python based transformer, and looks like it doesn't support international characters if Python interpreter version is 2.7. In order to avoid this error, you should change the Python Compatibility parameter to 3.4+ or later.

Note: Python 2.7 support would be removed from FME in the near future.

Probably this workflow generates a result closer to your desired one.

Thank you, Takashi. It seems to have error font in collumns.

Could you tell me how to fix it? Thank you


takashi
Celebrity
  • 7843 replies
  • December 28, 2018

Thank you, Takashi. It seems to have error font in collumns.

Could you tell me how to fix it? Thank you

That's bad... I think there is a defect on internationalization of FME.

I'd recommend you to contact Safe support to ask them to improve FME.


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • December 28, 2018

That's bad... I think there is a defect on internationalization of FME.

I'd recommend you to contact Safe support to ask them to improve FME.

Yes. Thank you so much :)

takashi
Celebrity
  • 7843 replies
  • December 28, 2018

Thank you, Takashi. It seems to have error font in collumns.

Could you tell me how to fix it? Thank you

Hi @hoa_le, if the workspace would be run on Windows Vietnamese Edition, the AttributeEncoder might be a workaround in the interim.

Try this one (I cannot test it in my environment).


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • December 28, 2018

Hi @hoa_le, if the workspace would be run on Windows Vietnamese Edition, the AttributeEncoder might be a workaround in the interim.

Try this one (I cannot test it in my environment).

Hi @takashi. It's still error :(. We use utf-8. Windows Vietnamese can't use.


takashi
Celebrity
  • 7843 replies
  • December 28, 2018

Hi @takashi. It's still error :(. We use utf-8. Windows Vietnamese can't use.

Sad to hear that. It's definitely a Safe's support case. Please report the problem to Safe as a defect of the current version of FME.

https://www.safe.com/support/report-a-problem/


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • December 28, 2018

Sad to hear that. It's definitely a Safe's support case. Please report the problem to Safe as a defect of the current version of FME.

https://www.safe.com/support/report-a-problem/

Yes, I report it to Safe. Thank you so much :)

jovitaatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • 635 replies
  • January 14, 2019
Yes, I report it to Safe. Thank you so much :)

Hi @hoa_le,

Thanks for reporting the issue. For anyone else following this question, FME handles attribute names with systems default encoding and doesn't have the same encoding application as the data values, which is why the values are displaying correctly but the header row is not. Writing out in Excel, the first header row contains the attribute names if you select to write that out in the parameters.

 

One potential workaround is to extract the desired first row as data values and re-insert it into the excel output. Takashi's answer from this Q&A might be helpful for that.

 

Our team is working hard on extending that functionality for the future so that the attribute names will be handled correctly. The issue is FMEENGINE-56578, and we'll let let you know when the issue has been addressed. Thanks everyone!


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 142 replies
  • January 15, 2019

Hi @hoa_le,

Thanks for reporting the issue. For anyone else following this question, FME handles attribute names with systems default encoding and doesn't have the same encoding application as the data values, which is why the values are displaying correctly but the header row is not. Writing out in Excel, the first header row contains the attribute names if you select to write that out in the parameters.

 

One potential workaround is to extract the desired first row as data values and re-insert it into the excel output. Takashi's answer from this Q&A might be helpful for that.

 

Our team is working hard on extending that functionality for the future so that the attribute names will be handled correctly. The issue is FMEENGINE-56578, and we'll let let you know when the issue has been addressed. Thanks everyone!

Thank you so much :)