Abacn commented on code in PR #17708:
URL: https://github.com/apache/beam/pull/17708#discussion_r886835983


##########
sdks/python/apache_beam/io/fileio.py:
##########
@@ -525,8 +526,11 @@ def __init__(
   @staticmethod
   def _get_sink_fn(input_sink):
     # type: (...) -> Callable[[Any], FileSink]
-    if isinstance(input_sink, FileSink):
-      return lambda x: input_sink
+    if isinstance(input_sink, type) and issubclass(input_sink, FileSink):

Review Comment:
   Now the call of `self.sink_fn(destination)` will produce a new FileSink 
instance and assign to sink. Yeah it sounds odd but FileSink constructors does 
not have any parameter passed in. The destination is actually assigned by the 
[open()](https://github.com/apache/beam/blob/d0c0dee32cf42fdaeb4e9b1556419906eb104029/sdks/python/apache_beam/io/fileio.py#L812)
 method.



-- 
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