You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "liferoad (via GitHub)" <gi...@apache.org> on 2023/05/27 22:20:24 UTC

[GitHub] [beam] liferoad opened a new pull request, #26923: fix output_handler

liferoad opened a new pull request, #26923:
URL: https://github.com/apache/beam/pull/26923

   Fix #26836
   
   #19268 replaced OutputProcessor with OutputHandler but DoFnInvoker.create_invoker still uses `output_processor`.
   
   ------------------------
   
   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)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/workflows/Go%20tests/badge.svg?branch=master&event=schedule)](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] Abacn commented on pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1572711685

   Run Python 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] liferoad commented on pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1572997850

   Run Python_Transforms 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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214472716


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   this is unit test. Not neessary. Real file system is unpredictable (like here)
   
   Apparently tempfile module does not work well in windows and try to write to the beam repo, which does not have write access.



-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214350326


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   I see, this means GroupIntoBatches still cannot working in direct runner. It now throws AttributeError.
   
   assertRaises here actually tests the feature gap for sdf_direct_runner exists
   
   In this sense think unit test belongs to sdf_direct_runner_test:
   
   https://github.com/apache/beam/blob/master/sdks/python/apache_beam/runners/direct/sdf_direct_runner_test.py
   
   
   



-- 
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 #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214491123


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   I know. But the tests are also great sources for examples.



-- 
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 #26923: fix output_handler

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1565711006

   Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control


-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214447959


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   We should then leave some comment to the added test sth like
   
   # TODO sdf_direct_runner currently does not support GroupIntoBatches and will throw this AttributeError



##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   We should then leave some comment to the added test sth like
   
   ```
   # TODO sdf_direct_runner currently does not support GroupIntoBatches and will throw this AttributeError
   ```



-- 
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] Abacn commented on pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1572713810

   ```
   apache_beam.transforms.util_test.GroupIntoBatchesTest.test_in_global_window_with_text_file (from py310-cython)
   
   AttributeError: 'apache_beam.runners.common.MethodWrapper' object has no attribute 'watermark_estimator_provider' [while running 'ReadFromText/Read/SDFBoundedSourceReader/ParDo(SDFBoundedSourceDoFn)/pair']
   ```
   
   This might be related. (groupintobatches fails on direct runner)


-- 
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 #26923: fix output_handler

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1565717625

   ## [Codecov](https://app.codecov.io/gh/apache/beam/pull/26923?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#26923](https://app.codecov.io/gh/apache/beam/pull/26923?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (6b524b9) into [master](https://app.codecov.io/gh/apache/beam/commit/94078e542241eaed0824e0153aa4c2917945ea55?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (94078e5) will **decrease** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #26923      +/-   ##
   ==========================================
   - Coverage   71.28%   71.27%   -0.01%     
   ==========================================
     Files         766      766              
     Lines      103470   103470              
   ==========================================
   - Hits        73756    73746      -10     
   - Misses      28175    28185      +10     
     Partials     1539     1539              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | python | `80.85% <ø> (-0.02%)` | :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/26923?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...on/apache\_beam/runners/direct/sdf\_direct\_runner.py](https://app.codecov.io/gh/apache/beam/pull/26923?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3Qvc2RmX2RpcmVjdF9ydW5uZXIucHk=) | `35.53% <ø> (ø)` | |
   
   ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/apache/beam/pull/26923/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] liferoad commented on pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1572984846

   Run Python 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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214530473


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   Nice! (so I wrongly blamed windows file system) We can keep it then 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


[GitHub] [beam] liferoad commented on a diff in pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1210771856


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -902,6 +904,19 @@ def test_in_global_window(self):
                       GroupIntoBatchesTest.BATCH_SIZE))
           ]))
 
+  def test_in_global_window_with_text_file(self):
+    with self.assertRaises(NotImplementedError):

Review Comment:
   @TheNeuralBit FYI



-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214461928


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   I mean we no longer need `test_in_global_window_with_text_file`. It fails on Github Action



-- 
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] Abacn merged pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #26923:
URL: https://github.com/apache/beam/pull/26923


-- 
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 pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1565710207

   R: @tvalentyn 


-- 
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] TheNeuralBit commented on pull request #26923: fix output_handler

Posted by "TheNeuralBit (via GitHub)" <gi...@apache.org>.
TheNeuralBit commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1568969402

   Please add a test that reproduces the original issue. Otherwise LGTM


-- 
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] tvalentyn commented on pull request #26923: fix output_handler

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1570976026

   are unit test failures caused by this change?


-- 
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 #26923: fix output_handler

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1565711068

   Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control


-- 
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 pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1565710376

   R: @TheNeuralBit 


-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214472716


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   this is unit test. Not neessary. Real file system is unpredictable (like here)



-- 
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] Abacn commented on pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1574145313

   tests succeeded though not update status, merging for now


-- 
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 #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214471226


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   Let me fix that test for windows. More tests are better. In particular, it tests reading the actual file.



-- 
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] Abacn commented on pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1572711905

   Run Python_Transforms 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] liferoad commented on a diff in pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214437603


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   I do not think we should waste time on this given we will not improve DirectRunner. This failure now is directly linked to GroupIntoBatches, which is also experimental.  



-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214530473


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   Nice! We can keep it then 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


[GitHub] [beam] liferoad commented on pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on PR #26923:
URL: https://github.com/apache/beam/pull/26923#issuecomment-1572732902

   Run Python 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] liferoad commented on a diff in pull request #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214491550


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   and I think I fixed the window test.



-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214446022


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   Fine. The test still fails on GitHub Action windows:
   
   ```
       def test_in_global_window_with_text_file(self):
         with tempfile.NamedTemporaryFile(suffix=".json") as f:
   >       with open(f.name, "w") as fh:
   E       PermissionError: [Errno 13] Permission denied: 'D:\\a\\beam\\beam\\sdks\\python\\target\\.tox\\py37-win\\tmp\\tmphcz3z87a.json'
   ```
   
   a simpler test is suggested here: https://github.com/apache/beam/issues/26836#issuecomment-1573128291



-- 
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] Abacn commented on a diff in pull request #26923: fix output_handler

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1214447959


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -908,7 +908,7 @@ def test_in_global_window_with_text_file(self):
     with tempfile.NamedTemporaryFile(suffix=".json") as f:
       with open(f.name, "w") as fh:
         json.dump(GroupIntoBatchesTest._create_test_data(), fh)
-      with self.assertRaises(RuntimeError):
+      with self.assertRaises((RuntimeError, AttributeError)):

Review Comment:
   We should then leave some comment to the added test sth like
   
   ```
   # TODO sdf_direct_runner currently does not support GroupIntoBatches from bundles of SDF source and will throw this AttributeError
   ```



-- 
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 #26923: fix output_handler

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #26923:
URL: https://github.com/apache/beam/pull/26923#discussion_r1210757830


##########
sdks/python/apache_beam/transforms/util_test.py:
##########
@@ -902,6 +904,19 @@ def test_in_global_window(self):
                       GroupIntoBatchesTest.BATCH_SIZE))
           ]))
 
+  def test_in_global_window_with_text_file(self):
+    with self.assertRaises(NotImplementedError):

Review Comment:
   note this test just confirms the code path with output_handler works but the feature is not implemented for DirectRunner



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