title: Cant convert datetime string to datetime object inside Apache Beam | beam.row()
body: <p>I am trying to simply cast my datetime strings into a datetime object. It works outside of the <code>beam.row()</code> but for some reason always fails when I try running it in apache beam.</p>
  <pre><code>import os
  import ipdb
  import typing
  import apache_beam                                        as beam
  import pandas                                             as pd
  import apache_beam.runners.interactive.interactive_beam   as ib
  import apache_beam.runners.interactive.interactive_runner as ir
  
  from datetime                      import datetime
  from apache_beam.dataframe.convert import to_dataframe
  from apache_beam.dataframe.convert import to_pcollection
  
  
  p = beam.Pipeline(ir.InteractiveRunner())
  
  test = (
          p 
          | beam.io.ReadFromText(ref_path, skip_header_lines = 1)
          | beam.Map(lambda x: x.split(','))
          | beam.Map(lambda x: beam.Row(
                                        isin           = str(x[0]),
                                        year           = int(x[1]),
                                        net_income     = float(x[2]),
                                        equity         = float(x[3]),
                                        n_shares       = float(x[4]),
                                        report_start   = datetime.strptime(x[5], &quot;%Y-%m-%dT%H:%M:%S&quot;)
                                        ))
          )
  </code></pre>
  <p>Error message received</p>
  <p><a href="https://i.stack.imgur.com/SmRoQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SmRoQ.png" alt="enter image description here" /></a></p>
  <p>I have run a test on my datetime string seperately and it works as expected. What am I doing wrong?</p>
  <pre><code>datetime.strptime('2000-01-01T00:00:00', '%Y-%m-%dT%H:%M:%S')                                                                    
  &gt; datetime.datetime(2000, 1, 1, 0, 0)
  </code></pre>