You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "robertwb (via GitHub)" <gi...@apache.org> on 2023/07/10 23:18:17 UTC
[GitHub] [beam] robertwb opened a new pull request, #27444: Remove obsolete native (dataflow) io from Beam Python.
robertwb opened a new pull request, #27444:
URL: https://github.com/apache/beam/pull/27444
Filed https://github.com/apache/beam/issues/27443 for further cleanup of PubSub.
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
--
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
[GitHub] [beam] robertwb merged pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb merged PR #27444:
URL: https://github.com/apache/beam/pull/27444
--
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
[GitHub] [beam] robertwb commented on a diff in pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb commented on code in PR #27444:
URL: https://github.com/apache/beam/pull/27444#discussion_r1260210663
##########
sdks/python/apache_beam/pipeline_test.py:
##########
@@ -61,39 +60,9 @@
from apache_beam.utils import windowed_value
from apache_beam.utils.timestamp import MIN_TIMESTAMP
-# TODO(BEAM-1555): Test is failing on the service, with FakeSource.
-
-class FakeSource(NativeSource):
- """Fake source returning a fixed list of values."""
- class _Reader(object):
- def __init__(self, vals):
- self._vals = vals
- self._output_counter = Metrics.counter('main', 'outputs')
-
- def __enter__(self):
- return self
-
- def __exit__(self, exception_type, exception_value, traceback):
- pass
-
- def __iter__(self):
- for v in self._vals:
- self._output_counter.inc()
- yield v
-
- def __init__(self, vals):
- self._vals = vals
-
- def reader(self):
- return FakeSource._Reader(self._vals)
-
-
-class FakeUnboundedSource(NativeSource):
+class FakeUnboundedSource(SourceBase):
Review Comment:
This is not a public API. (It was explicitly marked "internal only" and sits inside the runners/dataflow directory.) It also doesn't work on any other distributed runners or Dataflow Runner v2. I decided to leave it out of CHANGES.md as I don't think it'd increase the signal to noise ratio there.
##########
sdks/python/apache_beam/io/gcp/pubsub.py:
##########
@@ -261,6 +261,7 @@ def __init__(
timestamp_attribute=timestamp_attribute)
def expand(self, pvalue):
+ # TODO(BEAM-27443): Apply a proper transform rather than Read.
Review Comment:
No reason other than trying to timebox my change. I'll try and follow up if no one beats me to it.
##########
sdks/python/apache_beam/runners/direct/direct_runner.py:
##########
@@ -83,18 +83,18 @@ def accept(self, pipeline):
pipeline.visit(self)
return self.supported_by_fnapi_runner
+ def enter_composite_transform(self, applied_ptransform):
+ # The FnApiRunner does not support streaming execution.
+ if isinstance(applied_ptransform.transform,
+ (ReadFromPubSub, WriteToPubSub)):
+ self.supported_by_fnapi_runner = False
+
def visit_transform(self, applied_ptransform):
transform = applied_ptransform.transform
+ print(applied_ptransform, transform)
Review Comment:
Done.
##########
sdks/python/apache_beam/runners/direct/direct_runner.py:
##########
@@ -83,18 +83,18 @@ def accept(self, pipeline):
pipeline.visit(self)
return self.supported_by_fnapi_runner
+ def enter_composite_transform(self, applied_ptransform):
+ # The FnApiRunner does not support streaming execution.
+ if isinstance(applied_ptransform.transform,
+ (ReadFromPubSub, WriteToPubSub)):
+ self.supported_by_fnapi_runner = False
Review Comment:
No, this should be sufficient.
--
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
[GitHub] [beam] github-actions[bot] commented on pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27444:
URL: https://github.com/apache/beam/pull/27444#issuecomment-1630009137
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @liferoad for label python.
R: @chamikaramj for label io.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
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
[GitHub] [beam] liferoad commented on a diff in pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #27444:
URL: https://github.com/apache/beam/pull/27444#discussion_r1259117701
##########
sdks/python/apache_beam/pipeline_test.py:
##########
@@ -61,39 +60,9 @@
from apache_beam.utils import windowed_value
from apache_beam.utils.timestamp import MIN_TIMESTAMP
-# TODO(BEAM-1555): Test is failing on the service, with FakeSource.
-
-class FakeSource(NativeSource):
- """Fake source returning a fixed list of values."""
- class _Reader(object):
- def __init__(self, vals):
- self._vals = vals
- self._output_counter = Metrics.counter('main', 'outputs')
-
- def __enter__(self):
- return self
-
- def __exit__(self, exception_type, exception_value, traceback):
- pass
-
- def __iter__(self):
- for v in self._vals:
- self._output_counter.inc()
- yield v
-
- def __init__(self, vals):
- self._vals = vals
-
- def reader(self):
- return FakeSource._Reader(self._vals)
-
-
-class FakeUnboundedSource(NativeSource):
+class FakeUnboundedSource(SourceBase):
Review Comment:
Do we have any integration test to cover these changes? Since we are removing `native_io`, shall we update `CHANGES.md` for 2.50.0?
--
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
[GitHub] [beam] chamikaramj commented on a diff in pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on code in PR #27444:
URL: https://github.com/apache/beam/pull/27444#discussion_r1260034538
##########
sdks/python/apache_beam/runners/direct/direct_runner.py:
##########
@@ -83,18 +83,18 @@ def accept(self, pipeline):
pipeline.visit(self)
return self.supported_by_fnapi_runner
+ def enter_composite_transform(self, applied_ptransform):
+ # The FnApiRunner does not support streaming execution.
+ if isinstance(applied_ptransform.transform,
+ (ReadFromPubSub, WriteToPubSub)):
+ self.supported_by_fnapi_runner = False
Review Comment:
We don't need to set this for the source anymore ?
##########
sdks/python/apache_beam/runners/direct/direct_runner.py:
##########
@@ -83,18 +83,18 @@ def accept(self, pipeline):
pipeline.visit(self)
return self.supported_by_fnapi_runner
+ def enter_composite_transform(self, applied_ptransform):
+ # The FnApiRunner does not support streaming execution.
+ if isinstance(applied_ptransform.transform,
+ (ReadFromPubSub, WriteToPubSub)):
+ self.supported_by_fnapi_runner = False
+
def visit_transform(self, applied_ptransform):
transform = applied_ptransform.transform
+ print(applied_ptransform, transform)
Review Comment:
Delete print ?
##########
sdks/python/apache_beam/pipeline_test.py:
##########
@@ -61,39 +60,9 @@
from apache_beam.utils import windowed_value
from apache_beam.utils.timestamp import MIN_TIMESTAMP
-# TODO(BEAM-1555): Test is failing on the service, with FakeSource.
-
-class FakeSource(NativeSource):
- """Fake source returning a fixed list of values."""
- class _Reader(object):
- def __init__(self, vals):
- self._vals = vals
- self._output_counter = Metrics.counter('main', 'outputs')
-
- def __enter__(self):
- return self
-
- def __exit__(self, exception_type, exception_value, traceback):
- pass
-
- def __iter__(self):
- for v in self._vals:
- self._output_counter.inc()
- yield v
-
- def __init__(self, vals):
- self._vals = vals
-
- def reader(self):
- return FakeSource._Reader(self._vals)
-
-
-class FakeUnboundedSource(NativeSource):
+class FakeUnboundedSource(SourceBase):
Review Comment:
Probably good to update CHANGES.md since we are deleting some public APIs here (though we don't expect anyone other than Dataflow to have used these).
##########
sdks/python/apache_beam/io/gcp/pubsub.py:
##########
@@ -261,6 +261,7 @@ def __init__(
timestamp_attribute=timestamp_attribute)
def expand(self, pvalue):
+ # TODO(BEAM-27443): Apply a proper transform rather than Read.
Review Comment:
Also, is there a reason we cannot do this refactoring here ? (just for my information).
##########
sdks/python/apache_beam/io/gcp/pubsub.py:
##########
@@ -261,6 +261,7 @@ def __init__(
timestamp_attribute=timestamp_attribute)
def expand(self, pvalue):
+ # TODO(BEAM-27443): Apply a proper transform rather than Read.
Review Comment:
Nit: `TODO(https://github.com/apache/beam/issues/27443)` might be better so that we don't have to do URL modification to find the correct link.
--
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
[GitHub] [beam] codecov[bot] commented on pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #27444:
URL: https://github.com/apache/beam/pull/27444#issuecomment-1631463870
## [Codecov](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#27444](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (e4a00ed) into [master](https://app.codecov.io/gh/apache/beam/commit/bd59d09a9bb03e9663b0d4c3f883b6f9137efd54?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (bd59d09) will **decrease** coverage by `0.06%`.
> The diff coverage is `89.47%`.
```diff
@@ Coverage Diff @@
## master #27444 +/- ##
==========================================
- Coverage 71.22% 71.17% -0.06%
==========================================
Files 862 861 -1
Lines 104670 104521 -149
==========================================
- Hits 74550 74391 -159
- Misses 28572 28582 +10
Partials 1548 1548
```
| Flag | Coverage Δ | |
|---|---|---|
| python | `80.38% <89.47%> (-0.06%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/io/gcp/pubsub.py](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL3B1YnN1Yi5weQ==) | `91.36% <80.00%> (+0.57%)` | :arrow_up: |
| [sdks/python/apache\_beam/io/iobase.py](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vaW9iYXNlLnB5) | `85.35% <87.50%> (+0.17%)` | :arrow_up: |
| [...python/apache\_beam/runners/direct/direct\_runner.py](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvZGlyZWN0X3J1bm5lci5weQ==) | `93.91% <100.00%> (-0.02%)` | :arrow_down: |
| [.../apache\_beam/runners/direct/transform\_evaluator.py](https://app.codecov.io/gh/apache/beam/pull/27444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdHJhbnNmb3JtX2V2YWx1YXRvci5weQ==) | `92.24% <100.00%> (-2.38%)` | :arrow_down: |
... and [8 files with indirect coverage changes](https://app.codecov.io/gh/apache/beam/pull/27444/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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
[GitHub] [beam] robertwb commented on pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb commented on PR #27444:
URL: https://github.com/apache/beam/pull/27444#issuecomment-1632890065
Run Python_Examples PreCommit
--
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
[GitHub] [beam] robertwb commented on a diff in pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb commented on code in PR #27444:
URL: https://github.com/apache/beam/pull/27444#discussion_r1259945803
##########
sdks/python/apache_beam/pipeline_test.py:
##########
@@ -61,39 +60,9 @@
from apache_beam.utils import windowed_value
from apache_beam.utils.timestamp import MIN_TIMESTAMP
-# TODO(BEAM-1555): Test is failing on the service, with FakeSource.
-
-class FakeSource(NativeSource):
- """Fake source returning a fixed list of values."""
- class _Reader(object):
- def __init__(self, vals):
- self._vals = vals
- self._output_counter = Metrics.counter('main', 'outputs')
-
- def __enter__(self):
- return self
-
- def __exit__(self, exception_type, exception_value, traceback):
- pass
-
- def __iter__(self):
- for v in self._vals:
- self._output_counter.inc()
- yield v
-
- def __init__(self, vals):
- self._vals = vals
-
- def reader(self):
- return FakeSource._Reader(self._vals)
-
-
-class FakeUnboundedSource(NativeSource):
+class FakeUnboundedSource(SourceBase):
Review Comment:
native_io is an internal implementation detail of Runner v1.
--
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
[GitHub] [beam] robertwb commented on pull request #27444: Remove obsolete native (dataflow) io from Beam Python.
Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb commented on PR #27444:
URL: https://github.com/apache/beam/pull/27444#issuecomment-1629885989
Finally delivering on the project of no native sources (modulo PubSub of course)!
--
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