Skip to main content

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.

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


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.


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?

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!

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.

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

Reply