Skip to content

Better error for reused pcollections.#3906

Closed
robertwb wants to merge 2 commits intoapache:masterfrom
robertwb:errors
Closed

Better error for reused pcollections.#3906
robertwb wants to merge 2 commits intoapache:masterfrom
robertwb:errors

Conversation

@robertwb
Copy link
Copy Markdown
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

p = pipeline.Pipeline(
'DirectRunner', PipelineOptions(sys.argv))
else:
if any(getattr(p, 'is_ephemeral', False) for p in pipelines):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should this be True?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, this should be False, which is the correct value if it's not present.

Copy link
Copy Markdown

@KesterTong KesterTong left a comment

Choose a reason for hiding this comment

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

Can you add a test for this, along the lines of

class MyObject(object):
  def __init__(self, pcollection):
    self.pcollection = pcollection


class CreateMyObject(beam.PTransform):
  def expand(self, data):
    return MyObject(data)


class TransformMyObject(beam.PTransform):
  def _extract_input_pvalues(self, data_and_my_object):
    data, my_object = data_and_my_object
    return data_and_my_object, [data, my_object.pcollection]

  def expand(self, data_and_my_object):
    return data_and_my_object


...
  def testErrorOnReuseOfPCollection(self):
    input_data = [1, 2, 3, 4]
    my_object = input_data | 'CreateMyObject' >> CreateMyObject()
    _ = (input_data, my_object) | 'TransformMyObject' >> TransformMyObject()

@aaltay
Copy link
Copy Markdown
Member

aaltay commented Oct 20, 2017

@robertwb any updates on this PR?

@reuvenlax
Copy link
Copy Markdown
Contributor

@robertwb ping

@aaltay
Copy link
Copy Markdown
Member

aaltay commented Jan 24, 2018

Can we close this PR?

Copy link
Copy Markdown
Contributor Author

@robertwb robertwb left a comment

Choose a reason for hiding this comment

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

Added a test as requested.

p = pipeline.Pipeline(
'DirectRunner', PipelineOptions(sys.argv))
else:
if any(getattr(p, 'is_ephemeral', False) for p in pipelines):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, this should be False, which is the correct value if it's not present.

@stale
Copy link
Copy Markdown

stale bot commented Jun 7, 2018

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 7, 2018
@stale
Copy link
Copy Markdown

stale bot commented Jun 14, 2018

This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@stale stale bot closed this Jun 14, 2018
@kennknowles kennknowles added stale and removed wontfix labels Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants