Skip to main content
Solved

Removing _ForceDataType from dynamic export flow

  • August 13, 2018
  • 6 replies
  • 6 views

jeroen
Contributor
Forum|alt.badge.img+15

Hey,

I'm having trouble removing the _ForceDataType from dynamic outputs in the following flow. The input schema is unknown so the AttributeExposer and than AttributeRemover does not work. So in a xml the _ForceDataType and in a shp _ForceData attribute is present in the output of the writer.

The origin of this attribute is the SchemaSetter see below and i use the No setting for this option. The output is set on dynamic schema, same as the attributes.

Best answer by nathanatsafe

Hi @JeroenR, @takashi, @david_r,

 

I didn't realize I had affected this case by implementing the force data type option in the SchemaSetter. Thanks to Takashi's simple suggestion the '_ForceDataType' attribute should not be anywhere on the output schema. I've published the updates on FME Hub.

 

Thanks!

 

Nathan
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.

6 replies

david_r
Celebrity
  • 8391 replies
  • August 13, 2018

I'm not sure I understand the issue. How is the SchemaSetter configured?


jeroen
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • 97 replies
  • August 13, 2018

When closing my workspace is saw a setting i had never seen before. Sorry for the question and hope none of you lost any time for it.

A very simple attributes to remove in the writer does the trick of removing this what i could not remove in the flow itself.


david_r
Celebrity
  • 8391 replies
  • August 13, 2018

When closing my workspace is saw a setting i had never seen before. Sorry for the question and hope none of you lost any time for it.

A very simple attributes to remove in the writer does the trick of removing this what i could not remove in the flow itself.

Weird, that shouldn't be necessary. You haven't modified the code in the PythonCaller, perhaps?

takashi
Celebrity
  • 7842 replies
  • August 13, 2018

When closing my workspace is saw a setting i had never seen before. Sorry for the question and hope none of you lost any time for it. 

A very simple attributes to remove in the writer does the trick of removing this what i could not remove in the flow itself.

0684Q00000ArK6KQAV.png

I looked at the current version of SchemaSetter (2018-05-31 updated) and found it would always add "_ForceDataType" to the schema definition.

 

It would be better to modify the Python script in order to exclude "_FourceDataType" from the schema definition, @NathanAtSafe. For example: 

 

        #loop through all attributes and add to schema if they fail exclusion criteria
        i=0
        ExcludedAttributes=str(feature.getAttribute('_AttributesToExclude')).split(",")
        ExcludedAttributes.append('_ForceDataType') ### Add this line!

nathanatsafe
Safer
Forum|alt.badge.img+9
  • Safer
  • 284 replies
  • August 13, 2018
I looked at the current version of SchemaSetter (2018-05-31 updated) and found it would always add "_ForceDataType" to the schema definition.

 

It would be better to modify the Python script in order to exclude "_FourceDataType" from the schema definition, @NathanAtSafe. For example: 

 

        #loop through all attributes and add to schema if they fail exclusion criteria
        i=0
        ExcludedAttributes=str(feature.getAttribute('_AttributesToExclude')).split(",")
        ExcludedAttributes.append('_ForceDataType') ### Add this line!
@takashi Excellent find, Takashi. The line you suggest does remove the extraneous attribute. I'll add it and republish the SchemaSetter.

nathanatsafe
Safer
Forum|alt.badge.img+9
  • Safer
  • 284 replies
  • Best Answer
  • August 13, 2018

Hi @JeroenR, @takashi, @david_r,

 

I didn't realize I had affected this case by implementing the force data type option in the SchemaSetter. Thanks to Takashi's simple suggestion the '_ForceDataType' attribute should not be anywhere on the output schema. I've published the updates on FME Hub.

 

Thanks!

 

Nathan