Skip to content

[BEAM-7819] Add missing fields to python apache_beam.io.gcp.pubsub.PubsubMessage#14767

Merged
pabloem merged 1 commit intoapache:masterfrom
odenio:add-missing-pubsubmessage-attrs
May 12, 2021
Merged

[BEAM-7819] Add missing fields to python apache_beam.io.gcp.pubsub.PubsubMessage#14767
pabloem merged 1 commit intoapache:masterfrom
odenio:add-missing-pubsubmessage-attrs

Conversation

@n-oden
Copy link
Copy Markdown
Contributor

@n-oden n-oden commented May 8, 2021

  • Add the publish_time, message_id and ordering_key
    attributes to the PubsubMessage class
  • Convert google.protobuf.timestamp_pb2.Timestamp to python
    datetime in _from_proto_str
  • Ensure message_id and publish_time fields are unset
    in WriteToPubsub

This also addresses [BEAM-10958]


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python --- Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Examples testing status on various runners

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- --- --- --- --- --- ---
Java --- Build Status
Build Status
Build Status
--- --- --- --- ---
Python --- --- --- --- --- --- ---
XLang --- --- --- --- --- --- ---

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status Build Status Build Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@n-oden
Copy link
Copy Markdown
Contributor Author

n-oden commented May 8, 2021

R: @pabloem

Is it expected that the formatter/lint tests will fail? It's mostly indentation errors on lines I haven't changed

@codecov
Copy link
Copy Markdown

codecov bot commented May 8, 2021

Codecov Report

Merging #14767 (591e2a1) into master (9dbc7b7) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14767      +/-   ##
==========================================
  Coverage   83.79%   83.79%              
==========================================
  Files         439      878     +439     
  Lines       59118   118266   +59148     
==========================================
+ Hits        49536    99101   +49565     
- Misses       9582    19165    +9583     
Impacted Files Coverage Δ
...sdks/python/apache_beam/portability/python_urns.py
...d/srcs/sdks/python/apache_beam/io/filebasedsink.py
..._beam/testing/benchmarks/nexmark/queries/query0.py
...ython/apache_beam/io/gcp/tests/bigquery_matcher.py
..._beam/testing/benchmarks/nexmark/queries/query5.py
...sdks/python/apache_beam/ml/gcp/visionml_test_it.py
...sdks/python/apache_beam/transforms/environments.py
..._beam/runners/portability/sdk_container_builder.py
...mples/snippets/transforms/elementwise/partition.py
...ache_beam/runners/portability/expansion_service.py
... and 1307 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9dbc7b7...591e2a1. Read the comment docs.

@aaltay
Copy link
Copy Markdown
Member

aaltay commented May 9, 2021

R: @pabloem

Is it expected that the formatter/lint tests will fail? It's mostly indentation errors on lines I haven't changed

It seems to be failing on the lines you have changed. Please try fixing those.

@n-oden
Copy link
Copy Markdown
Contributor Author

n-oden commented May 10, 2021

@aaltay ugh, my editor was configured to auto-apply Black formatting on save of any .py file and much ugliness ensued as a result. I've pried it all out and the format/lint tests are passing now.

...but obviously the precommit test is not. But the precommit test suite is so enormous that I'm having trouble seeing in the logs what portion of that might be related to my change. FWIW, python setup.py test -s apache_beam.io.gcp passes for me locally:

----------------------------------------------------------------------
Ran 365 tests in 38.591s

OK (skipped=38)

(Edit: spot-checked some of the failures, and it looks like apache_beam.runners.portability.flink_runner_test.FlinkRunnerTestStreaming is broken on master as well as in my branch so I'm going to tentatively assert that those failures are unrelated to this change)

@aaltay
Copy link
Copy Markdown
Member

aaltay commented May 10, 2021

@aaltay ugh, my editor was configured to auto-apply Black formatting on save of any .py file and much ugliness ensued as a result. I've pried it all out and the format/lint tests are passing now.

...but obviously the precommit test is not. But the precommit test suite is so enormous that I'm having trouble seeing in the logs what portion of that might be related to my change. FWIW, python setup.py test -s apache_beam.io.gcp passes for me locally:

----------------------------------------------------------------------
Ran 365 tests in 38.591s

OK (skipped=38)

(Edit: spot-checked some of the failures, and it looks like apache_beam.runners.portability.flink_runner_test.FlinkRunnerTestStreaming is broken on master as well as in my branch so I'm going to tentatively assert that those failures are unrelated to this change)

If it is broken on master you do not need to worry about it now. Let's get it reviewed and hopefully master would be fixed by that time.

@aaltay aaltay requested a review from pabloem May 10, 2021 18:02
@ibzib
Copy link
Copy Markdown

ibzib commented May 10, 2021

(Edit: spot-checked some of the failures, and it looks like apache_beam.runners.portability.flink_runner_test.FlinkRunnerTestStreaming is broken on master as well as in my branch so I'm going to tentatively assert that those failures are unrelated to this change)

I don't see that FlinkRunnerTestStreaming failed in https://ci-beam.apache.org/job/beam_PreCommit_Python_Commit/18572/ (IIRC Flink tests are skipped in this job, so I wonder if you are testing a different command than the precommit uses?). Instead I see FnApiRunnerTestWithGrpcAndMultiWorkers.test_sdf_default_truncate_when_unbounded failed, which could be a flake. Re-running to confirm.

@ibzib
Copy link
Copy Markdown

ibzib commented May 10, 2021

Run Python PreCommit

1 similar comment
@ibzib
Copy link
Copy Markdown

ibzib commented May 10, 2021

Run Python PreCommit

@ibzib
Copy link
Copy Markdown

ibzib commented May 10, 2021

Python precommit has finally passed, looks like the failures were indeed flakes. I filed BEAM-12322 to track this issue.

…bsubMessage

- Add the `publish_time`, `message_id` and `ordering_key`
  attributes to the PubsubMessage class
- Convert google.protobuf.timestamp_pb2.Timestamp to python
  datetime in _from_proto_str
- Ensure `message_id` and `publish_time` fields are unset
  in WriteToPubsub
@n-oden n-oden requested a review from pabloem May 12, 2021 14:43
@pabloem
Copy link
Copy Markdown
Member

pabloem commented May 12, 2021

Run Python PreCommit

1 similar comment
@pabloem
Copy link
Copy Markdown
Member

pabloem commented May 12, 2021

Run Python PreCommit

@pabloem
Copy link
Copy Markdown
Member

pabloem commented May 12, 2021

Run Python 3.8 PostCommit

@pabloem pabloem merged commit c34aeae into apache:master May 12, 2021
@pabloem
Copy link
Copy Markdown
Member

pabloem commented May 12, 2021

LGTM. Thanks!

@n-oden n-oden deleted the add-missing-pubsubmessage-attrs branch May 13, 2021 15:23
@n-oden
Copy link
Copy Markdown
Contributor Author

n-oden commented Jun 17, 2021

@pabloem I was a little surprised to find that this didn't make it into the 2.30.0 release. Should I expect it in 2.31?

@n-oden
Copy link
Copy Markdown
Contributor Author

n-oden commented Jun 18, 2021

(cc @aaltay and @ibzib -- is there a timeline for this actually landing on a release branch?)

@ibzib
Copy link
Copy Markdown

ibzib commented Jun 18, 2021

Here is a link to the release policy: https://beam.apache.org/contribute/release-guide/

Once the release branch is cut, you can check to see if your change is included. This change will be included in the 2.31.0 release.

@ibzib
Copy link
Copy Markdown

ibzib commented Jun 18, 2021

Release branches are publicly visible at release-2.x.0 e.g. https://github.com/apache/beam/commits/release-2.31.0?after=9161c9417a6c58cc54367e58370a64f8050a3e59+139&branch=release-2.31.0

@astorrs
Copy link
Copy Markdown

astorrs commented Nov 12, 2021

It’s been months now and this still hasn’t been included in a release. As @n-oden said back in June, “is there a timeline for this actually landing on a release branch?”

@ibzib
Copy link
Copy Markdown

ibzib commented Nov 12, 2021

@astorrs All changes are automatically picked up by a "release cut" that happens roughly once every 6 weeks. https://beam.apache.org/contribute/#when-will-my-change-show-up-in-an-apache-beam-release

This change was included starting with the 2.31.0 release of Beam in June. If you still see this bug in newer versions of Beam, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants