You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/01 01:42:06 UTC

[GitHub] [beam] Abacn commented on a diff in pull request #17708: [BEAM-12554] Create new instances of FileSink in sink_fn

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


##########
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:
   Yes this is correct. Previously sink=fileio.TextSink() generated unexpected behavior as stated in the ticket.



-- 
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-unsubscribe@beam.apache.org

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