You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 20:01:33 UTC

[GitHub] [beam] damccorm opened a new issue, #20876: "An Example Test for a Composite Transform" in Python is broken

damccorm opened a new issue, #20876:
URL: https://github.com/apache/beam/issues/20876

   The example test code does not runĀ [1]:
    - Python reports a Syntax error "SyntaxError: unexpected EOF while parsing"
    - Missing imports: "import unittest" and "import apache_beam as beam"
    - After fixing the above issues, I get: "AttributeError: module 'apache_beam' has no attribute 'TestPipeline'". It looks like this import is just wrong. I tracked it down via code search in "apache_beam.testing.test_pipeline"
   
   [1] https://beam.apache.org/documentation/pipelines/test-your-pipeline/#an-example-test-for-a-composite-transform
   
   Imported from Jira [BEAM-12236](https://issues.apache.org/jira/browse/BEAM-12236). Original Jira may contain additional context.
   Reported by: shoyer.


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] "An Example Test for a Composite Transform" in Python is broken [beam]

Posted by "damccorm (via GitHub) via github" <gi...@beam.apache.org>.
damccorm commented on issue #20876:
URL: https://github.com/apache/beam/issues/20876#issuecomment-6749005616

   Fixed by #15630 (commit 3c3bfa36eb92e104229db9e827d723bed8ae0840) and #25425 (commit ad5e17edb8f500955f8eced56f4624ef833ccee0).


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


Re: [I] "An Example Test for a Composite Transform" in Python is broken [beam]

Posted by "jonathansudhakar1 (via GitHub) via github" <gi...@beam.apache.org>.
jonathansudhakar1 commented on issue #20876:
URL: https://github.com/apache/beam/issues/20876#issuecomment-6583337647

   This looks fixed on master. All three problems from the report have since been corrected in the Python snippet under "An Example Test for a Composite Transform":
   
   - The `TestPipeline` import was fixed to `from apache_beam.testing.test_pipeline import TestPipeline`, and the `WORDS` input was moved into the test, in https://github.com/apache/beam/commit/3c3bfa36eb92e104229db9e827d723bed8ae0840.
   - The missing `import unittest` and `import apache_beam as beam` were added in #25425 (https://github.com/apache/beam/commit/ad5e17edb8f500955f8eced56f4624ef833ccee0).
   
   As a check, I copied the current snippet from `website/www/site/content/en/documentation/pipelines/test-your-pipeline.md` (at 9fb00aacf21) into a file, added a `unittest.main()` call, and ran it against the Python SDK at that commit. `test_count` passed (`Ran 1 test ... OK`). Unless I have missed something, this issue can be closed.


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


Re: [I] "An Example Test for a Composite Transform" in Python is broken [beam]

Posted by "damccorm (via GitHub) via github" <gi...@beam.apache.org>.
damccorm closed issue #20876: "An Example Test for a Composite Transform" in Python is broken
URL: https://github.com/apache/beam/issues/20876


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