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/05/16 19:39:45 UTC
[GitHub] [beam] Abacn opened a new pull request, #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Abacn opened a new pull request, #17682:
URL: https://github.com/apache/beam/pull/17682
Currently the log of python unit test results contains thousands of lines of runtime warning / future warning / deprecation warnings, making trouble shooting during development inconvenient. The most popped warning is hundreds of lines of 'RuntimeWarning: Mean of empty slice
return np.nanmean(a, axis, out=out, keepdims=keepdims)'
raised in dataframe tests, which costs > 400 lines of logs. This warning could be suppressed.
**Please** add a meaningful description for your change here
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) 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](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/#make-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)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+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] asf-ci commented on pull request #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
asf-ci commented on PR #17682:
URL: https://github.com/apache/beam/pull/17682#issuecomment-1128062521
Can one of the admins verify this patch?
--
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 merged pull request #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
TheNeuralBit merged PR #17682:
URL: https://github.com/apache/beam/pull/17682
--
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 #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
Abacn commented on PR #17682:
URL: https://github.com/apache/beam/pull/17682#issuecomment-1128096843
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 #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
Abacn commented on code in PR #17682:
URL: https://github.com/apache/beam/pull/17682#discussion_r874148455
##########
sdks/python/apache_beam/dataframe/frames_test.py:
##########
@@ -1601,6 +1602,11 @@ def test_pivot_no_index_provided_on_multiindex(self):
class GroupByTest(_AbstractFrameTest):
"""Tests for DataFrame/Series GroupBy operations."""
+ @staticmethod
+ def median_sum_fn(x):
+ warnings.filterwarnings("ignore", message="Mean of empty slice")
+ return (x.foo + x.bar).median()
Review Comment:
Thanks for the suggestion. Applied.
--
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 a diff in pull request #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
TheNeuralBit commented on code in PR #17682:
URL: https://github.com/apache/beam/pull/17682#discussion_r874129298
##########
sdks/python/apache_beam/dataframe/frames_test.py:
##########
@@ -1723,28 +1729,24 @@ def test_groupby_callable(self):
def test_groupby_apply(self):
df = GROUPBY_DF
-
- def median_sum_fn(x):
- return (x.foo + x.bar).median()
-
Review Comment:
nit: I would actually keep these where they are and just duplicate the filterwarnings calls, so that the tests are more self-contained and easy to inspect (but I'm also fine with the move if you prefer it that way)
##########
sdks/python/apache_beam/dataframe/frames_test.py:
##########
@@ -1601,6 +1602,11 @@ def test_pivot_no_index_provided_on_multiindex(self):
class GroupByTest(_AbstractFrameTest):
"""Tests for DataFrame/Series GroupBy operations."""
+ @staticmethod
+ def median_sum_fn(x):
+ warnings.filterwarnings("ignore", message="Mean of empty slice")
+ return (x.foo + x.bar).median()
Review Comment:
Could we use a [context](https://docs.python.org/3/library/warnings.html#temporarily-suppressing-warnings) here to make sure the filters get reset?
--
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] asf-ci commented on pull request #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
asf-ci commented on PR #17682:
URL: https://github.com/apache/beam/pull/17682#issuecomment-1128062524
Can one of the admins verify this patch?
--
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 #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
Abacn commented on PR #17682:
URL: https://github.com/apache/beam/pull/17682#issuecomment-1128131872
>
Entered [BEAM-14477](https://issues.apache.org/jira/browse/BEAM-14477) for construction time warnings.
--
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 #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
Abacn commented on code in PR #17682:
URL: https://github.com/apache/beam/pull/17682#discussion_r874150664
##########
sdks/python/apache_beam/dataframe/frames_test.py:
##########
@@ -1723,28 +1729,24 @@ def test_groupby_callable(self):
def test_groupby_apply(self):
df = GROUPBY_DF
-
- def median_sum_fn(x):
- return (x.foo + x.bar).median()
-
Review Comment:
Yeah I agree with the idea. Given the amount of code added I considered pick up them into a separate helper function. Nevertheless it is still in the GroupByTest test class.
--
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 #17682: [BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #17682:
URL: https://github.com/apache/beam/pull/17682#issuecomment-1128095190
# [Codecov](https://codecov.io/gh/apache/beam/pull/17682?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17682](https://codecov.io/gh/apache/beam/pull/17682?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9920440) into [master](https://codecov.io/gh/apache/beam/commit/ee5888dbf5f14ce7c427b41b5884e342f5e971c7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee5888d) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #17682 +/- ##
=======================================
Coverage 73.99% 73.99%
=======================================
Files 695 695
Lines 91798 91798
=======================================
+ Hits 67927 67928 +1
+ Misses 22623 22622 -1
Partials 1248 1248
```
| Flag | Coverage Δ | |
|---|---|---|
| python | `83.74% <ø> (+<0.01%)` | :arrow_up: |
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=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17682?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/python/apache\_beam/transforms/combiners.py](https://codecov.io/gh/apache/beam/pull/17682/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9jb21iaW5lcnMucHk=) | `93.05% <0.00%> (-0.39%)` | :arrow_down: |
| [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/17682/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.30% <0.00%> (-0.25%)` | :arrow_down: |
| [sdks/python/apache\_beam/runners/common.py](https://codecov.io/gh/apache/beam/pull/17682/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9jb21tb24ucHk=) | `87.94% <0.00%> (-0.13%)` | :arrow_down: |
| [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/17682/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `89.09% <0.00%> (+0.15%)` | :arrow_up: |
| [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/17682/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `97.56% <0.00%> (+2.43%)` | :arrow_up: |
| [sdks/python/apache\_beam/internal/gcp/auth.py](https://codecov.io/gh/apache/beam/pull/17682/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvZ2NwL2F1dGgucHk=) | `78.66% <0.00%> (+5.33%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17682?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17682?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ee5888d...9920440](https://codecov.io/gh/apache/beam/pull/17682?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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