Skip to main content
Question

I keep getting a type error in my Python caller

  • April 6, 2023
  • 1 reply
  • 384 views

benadei
Participant
Forum|alt.badge.img+3

I keep getting an error in my Python caller transformer trying to convert dates in the format '%Y%m%d' to Python 'datetime.datetime' format. The transformer works for the first 236 features and generates the following error:

Python Exception <TypeError>: strptime() argument 1 must be str, not None

Traceback (most recent call last):

File "<string>", line 38, in input

TypeError: strptime() argument 1 must be str, not None

Error encountered while calling method `input'

I have examined the input data and nothing seems out of place or wrong with the data. I am not sure what's causing this.

1 reply

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • April 6, 2023

Hi @benadei​,

It looks like the attribute you are trying to convert is empty or missing on feature 237. In this case, the getAttribute() method will return None. Perhaps add an if before the conversion to test that value != None.


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