damccorm opened a new issue, #20580:
URL: https://github.com/apache/beam/issues/20580

   It would be nice to support `pathlib.Path`-like objects, as per PEP 519: 
https://www.python.org/dev/peps/pep-0519/
   
   Currently, the following fail with: `TypeError: file_path_prefix must be a 
string or ValueProvider;got 
PosixPath('/tmp/pytest-of-forge-00/pytest-0/test_ptransform_beam0/output0.txt') 
instead`
   
   ```
   
   import pathlib
   
   path = pathlib.Path('/path/to/home')
   beam.io.WriteToText(path)
   
   ```
   
   
   Raised by FileBasedSink:
   
   ```
   
   class FileBasedSink(iobase.Sink):
   
     def __init__(self)
       if not isinstance(file_path_prefix,
   ((str, unicode), ValueProvider)):
         raise TypeError(...)
   
   ```
   
   
   It could be implemented by calling `os.fspath(file_path_prefix)`
   
   Imported from Jira 
[BEAM-11135](https://issues.apache.org/jira/browse/BEAM-11135). Original Jira 
may contain additional context.
   Reported by: conchylicultor.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to