Skip to main content
Question

how to assign NULL (or MISSING) values inside a python caller?


arthy
Contributor
Forum|alt.badge.img+8
  • Contributor

Hi,

I would like to know how to assign an attribute value NULL using python?

 

 

I'm aware of the nullattributemapper transformer to do that but I would like to add this inside a python script.

Thanks

4 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 17, 2017

Unfortunately the python None value is resolved as an empty string in the setAttribute method.


carsonlam
Safer
Forum|alt.badge.img
  • Safer
  • July 17, 2017

FMEFeature.setAttributeNullWithType(attrName, attrType) should be what you're looking for. For most use cases, attrType doesn't matter, so you can use something like fmeobjects.FME_ATTR_UNDEFINED.


takashi
Influencer
  • July 17, 2017
carsonlam wrote:

FMEFeature.setAttributeNullWithType(attrName, attrType) should be what you're looking for. For most use cases, attrType doesn't matter, so you can use something like fmeobjects.FME_ATTR_UNDEFINED.

@carsonlam is right. You can use FMEFeature.setAttributeNullWithType method to set <null> to an attribute.

 

In addition, if you need to make a <missing> attribute, just remove the attribute with FMEFeature.removeAttribute(attrName) method.

 


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • July 20, 2017

thanks everyone


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings