Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-1345] Clearly delineate public api in apache_beam/coders. #3090

Closed
wants to merge 2 commits into from

Conversation

robertwb
Copy link
Contributor

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify.
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

@robertwb
Copy link
Contributor Author

R: @charlesccychen

@sb2nov
Copy link
Contributor

sb2nov commented May 11, 2017

can we remove the coders import from the root apache_beam/init.py then?

Copy link
Contributor

@charlesccychen charlesccychen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

"""For internal use only; no backwards-compatibility guarantees.

Returns the CoderImpl backing this Coder.
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also mark as_cloud_object(), get_estimated_size_and_observables() and the *_runner_api() functions in this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"""For internal use only; no backwards-compatibility guarantees.

Returns the CoderImpl backing this Coder.
"""
if not hasattr(self, '_impl'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also mark LengthPrefixCoder as internal / experimental?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -21,7 +21,7 @@
from __future__ import absolute_import
import logging

from apache_beam import coders
from apache_beam.coders import coders
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the guidance now for usage of the Coder class? Are users expected to do something like this?

class MyCoder(beam.coders.coders.Coder):
  ...

Did you also mean to change coders/__init__.py, or is the simpler form (beam.coders.Coder) still permitted / recommended in user code? (CC: @sb2nov)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coders/__init__.py changed because of the __all__ in coders/coders.py

This is only needed because it uses the no-public ToString Coder. beam.coders.Coder is still recommended.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@robertwb
Copy link
Contributor Author

Removing coders from apache_beam/__init__.py might be too invasive at this late stage of the game. If we want to do it, it should be a separate PR.

@robertwb
Copy link
Contributor Author

PTAL

Copy link
Contributor

@charlesccychen charlesccychen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@@ -21,7 +21,7 @@
from __future__ import absolute_import
import logging

from apache_beam import coders
from apache_beam.coders import coders
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@robertwb
Copy link
Contributor Author

Will merge as soon as tests finish (green).

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 70.172% when pulling 077709f on robertwb:py-all into 3eb76a7 on apache:master.

@robertwb
Copy link
Contributor Author

@aaltay for cherry-pick

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.

None yet

4 participants