Eliaaazzz commented on code in PR #38724:
URL: https://github.com/apache/beam/pull/38724#discussion_r3332476710


##########
sdks/python/apache_beam/io/unbounded_source.py:
##########
@@ -0,0 +1,826 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A minimal, self-contained ``UnboundedSource`` for the Python SDK.
+
+This module is a Week-1 proof-of-concept for GSoC 2026 (issue #19137). It 
brings
+the Java ``UnboundedSource`` abstractions to Python and makes them *runnable* 
on
+the portable Fn API path (e.g. the default DirectRunner) by dispatching reads
+through a Splittable ``DoFn`` -- inspired by (not a literal port of) Java's
+``Read.UnboundedSourceAsSDFWrapperFn``. The streaming-SDF template followed for
+the process-loop / watermark / defer plumbing is
+``apache_beam.transforms.periodicsequence``.
+
+Public API::
+
+    from apache_beam.io.unbounded_source import (
+        UnboundedSource, UnboundedReader, CheckpointMark, 
ReadFromUnboundedSource)
+
+    class MySource(UnboundedSource):
+      ...
+
+    with beam.Pipeline() as p:
+      p | ReadFromUnboundedSource(MySource()) | beam.Map(print)
+      # Equivalent (since iobase.Read.expand dispatches on source type):

Review Comment:
   Thanks for pointing this out. I revisited this and removed 
`poll_interval_seconds` from the public
   `ReadFromUnboundedSource` API.
   
   The Python wrapper still needs an internal delay on the no-data path because 
the portable SDF implementation
   resumes work via `tracker.defer_remainder(...)`; if no delay is provided, 
the residual is scheduled immediately. This is now just a private 
`_DEFAULT_POLL_INTERVAL_SECONDS` constant used by the wrapper, so users should 
not
   configure it and should normally use `beam.io.Read(MySource())`.
   
   I also understand `DEFAULT_BUNDLE_FINALIZATION_LIMIT_MINS` in Java as the 
bundle-finalization callback deadline rather than a user-facing polling option, 
so I did not add a corresponding public option in Python in the lastest commit. 



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