sorensenjs commented on issue #31152:
URL: https://github.com/apache/beam/issues/31152#issuecomment-2094493983

   That workaround code example doesn't work, because ReadFromCsv and 
WriteToCsv both produce/require schemas.
   
   Even if you were to use a ._asdict() like so
   
   ```  
   ( pipeline | beam.io.ReadFromCsv('/tmp/input.csv', dtype=str)
         | beam.Map(lambda x: x._asdict())
         | beam.Map(print)
   ```
   
   Conversion to str element by element will result in 'None' values instead of 
empty strings. Values interpreted as floating point may loose precision.
   
   ```
   {'a': 'text', 'b': 1, 'c': 21, 'd': 5945023, 'e': 376974, 'f': 0, 'g': 0, 
'h': 0, 'i': 1, 'j': 2, 'k': 0, 'l': 4, 'm': None, 'n': None, 'o': None, 'p': 
None, 'q': None, 'r': None}
   Elapsed time  0:00:00.878320
   {'a': 'text', 'b': '1', 'c': '21', 'd': '5945023', 'e': '376974', 'f': '0', 
'g': '0', 'h': '0', 'i': '1', 'j': '2', 'k': '0', 'l': '4', 'm': None, 'n': 
None, 'o': None, 'p': None, 'q': None, 'r': None}
   Elapsed time  0:00:24.243182
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to