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

[GitHub] [beam] alexeyinkin opened a new pull request, #26933: Embed the word count examples

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

   This PR embeds the word count examples to https://beam.apache.org/get-started/wordcount-example/
   
   ------------------------
   
   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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/python/aggregation/groupbykey.md:
##########
@@ -32,17 +32,9 @@ In the following example, we create a pipeline with a `PCollection` of produce k
 
 We use `GroupByKey` to group all the produce for each season.
 
-{{< highlight language="py" file="sdks/python/apache_beam/examples/snippets/transforms/aggregation/groupbykey.py" >}}

Review Comment:
   Don't remove static example. Add PGE as Example 2



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/combine.md:
##########
@@ -42,21 +42,20 @@ commumative operation. But, it allows the use of partial sums to be precomputed.
 See more information in the [Beam Programming Guide](/documentation/programming-guide/#combine).
 
 ## Examples
+
 **Example 1**: Global combine
+
 Use the global combine to combine all of the elements in a given `PCollection`
 into a single value, represented in your pipeline as a new `PCollection` containing
 one element. The following example code shows how to apply the Beam-provided
 sum combine function to produce a single sum value for a `PCollection` of integers.
 
-{{< highlight java >}}

Review Comment:
   Don't remove it.  Add PGE as Example 3
   
   



-- 
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] pabloem commented on a diff in pull request #26933: Embed examples

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


##########
learning/tour-of-beam/frontend/lib/pages/tour/widgets/playground.dart:
##########
@@ -57,6 +57,7 @@ class PlaygroundWidget extends StatelessWidget {
         SplitView(
           direction: Axis.vertical,
           first: SnippetEditor(
+            autofocus: true,

Review Comment:
   ok gotcha! thanks so much for the explanation



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/groupintobatches.md:
##########
@@ -34,7 +34,10 @@ to the output collection.
 Batches contain elements from the same window, so windows are preserved. Batches might contain elements from more than one bundle.
 
 ## Examples
-See [BEAM-7703](https://issues.apache.org/jira/browse/BEAM-7703) for updates.

Review Comment:
   Example 1:



-- 
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 #26933: Embed examples

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

   ## [Codecov](https://app.codecov.io/gh/apache/beam/pull/26933?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#26933](https://app.codecov.io/gh/apache/beam/pull/26933?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (342096d) into [master](https://app.codecov.io/gh/apache/beam/commit/74bad1add9cb6954c5f62aff81371c327546cc89?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (74bad1a) will **decrease** coverage by `0.01%`.
   > The diff coverage is `50.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #26933      +/-   ##
   ==========================================
   - Coverage   71.53%   71.52%   -0.01%     
   ==========================================
     Files         854      854              
     Lines      104093   104095       +2     
   ==========================================
   - Hits        74459    74456       -3     
   - Misses      28087    28092       +5     
     Partials     1547     1547              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | python | `81.02% <50.00%> (-0.01%)` | :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/26933?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...ppets/transforms/elementwise/tostring\_iterables.py](https://app.codecov.io/gh/apache/beam/pull/26933?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS90b3N0cmluZ19pdGVyYWJsZXMucHk=) | `87.50% <50.00%> (-12.50%)` | :arrow_down: |
   
   ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/apache/beam/pull/26933/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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/cogroupbykey.md:
##########
@@ -35,36 +35,10 @@ that key in each input collection.
 See more information in the [Beam Programming Guide](/documentation/programming-guide/#cogroupbykey).
 
 ## Examples
-**Example**: Say you have two different files with user data; one file has

Review Comment:
   Don't remove it. Mark as Example 1. Add PGE as Example 2



-- 
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] alexeyinkin commented on pull request #26933: Embed examples

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

   R: @pabloem 


-- 
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] alexeyinkin commented on a diff in pull request #26933: Embed examples

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


##########
learning/tour-of-beam/frontend/lib/pages/tour/widgets/playground.dart:
##########
@@ -57,6 +57,7 @@ class PlaygroundWidget extends StatelessWidget {
         SplitView(
           direction: Axis.vertical,
           first: SnippetEditor(
+            autofocus: true,

Review Comment:
   It is this bug: https://github.com/flutter/flutter/issues/106664
   
   It will not let the user click out of the iframe if a text field is focused in the iframe.
   The workaround we had for months is this package: https://pub.dev/packages/akvelon_flutter_issue_106664_workaround
   
   It de-focuses any text field when the mouse is moved out of the iframe:
   https://github.com/akvelon/flutter-issue-106664-workaround/blob/main/lib/src/web.dart
   
   What we have just discovered is that this workaround does not work when the playground is created when the mouse is initially out of the iframe. You can see this bug on the website stage for this PR. It will be gone when the playground is deployed from this PR.
   
   So the solution is to auto-focus only in the standalone playground, and not in the embedded playground. This is what this change does.



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/distinct.md:
##########
@@ -33,22 +33,11 @@ values for each key.
 
 ## Examples
 
-**Example 1** Find the distinct element from a `PCollection` of `String`.
+**Example 1**: Find the distinct element from a `PCollection` of `String`.

Review Comment:
   Don't remove current static example. MaAdd PGE as "Example 2: Find the distinct element from a `PCollection` of `Integer`"



##########
website/www/site/content/en/documentation/transforms/java/aggregation/distinct.md:
##########
@@ -33,22 +33,11 @@ values for each key.
 
 ## Examples
 
-**Example 1** Find the distinct element from a `PCollection` of `String`.
+**Example 1**: Find the distinct element from a `PCollection` of `String`.

Review Comment:
   Don't remove current static example. Add PGE as "Example 2: Find the distinct element from a `PCollection` of `Integer`"



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/latest.md:
##########
@@ -35,13 +35,10 @@ A transform and `Combine.CombineFn` for computing the latest element in a collec
 For elements with the same timestamp, the output element is arbitrarily selected.
 
 ## Examples
-**Example**: compute the latest value for each session

Review Comment:
   Don't remove current static example. Add PGE as "Example 2"



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/get-started/wordcount-example.md:
##########
@@ -1325,6 +1355,15 @@ word_counts = windowed_words | CountWords()
 counted := wordcount.CountWords(s, windowedLines)
 {{< /highlight >}}
 
+{{< paragraph class="language-java language-py" >}}
+### Try the full example in Playground

Review Comment:
   Resolved



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/max.md:
##########
@@ -31,19 +31,16 @@ values in a collection, either globally or for each key.
 ## Examples
 **Example 1**: get the maximum of a `PCollection` of `Doubles`.
 
-{{< highlight java >}}
-PCollection<Double> input = ...;
-PCollection<Double> max = input.apply(Max.doublesGlobally());
-{{< /highlight >}}
+{{< playground height="700px" >}}

Review Comment:
   Don't remove current static examples. Add PGE as "Example 3"



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/groupbykey.md:
##########
@@ -36,10 +36,10 @@ windowing or triggering is necessary when processing unbounded collections.
 See more information in the [Beam Programming Guide](/documentation/programming-guide/#groupbykey).
 
 ## Examples
-**Example 1**: (a, 1), (b, 2), (a, 3) will result into (a, [1, 3]), (b, [2]).
 
-**Example 2**: Given a collection of customer orders keyed by postal code,
-you could use `GroupByKey` to get the collection of all orders in each postal code.
+{{< playground height="700px" >}}

Review Comment:
   Example 1:



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/count.md:
##########
@@ -39,7 +39,18 @@ transform has three varieties:
   appeared in the original collection.
 
 ## Examples
-See [BEAM-7703](https://issues.apache.org/jira/browse/BEAM-7703) for updates.
+
+**Example 1**:

Review Comment:
   **Example 1**: Count.globally



-- 
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 #26933: Embed examples

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

   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] pabloem merged pull request #26933: Embed examples

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


-- 
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] pabloem commented on pull request #26933: Embed examples

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

   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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/get-started/wordcount-example.md:
##########
@@ -1325,6 +1355,15 @@ word_counts = windowed_words | CountWords()
 counted := wordcount.CountWords(s, windowedLines)
 {{< /highlight >}}
 
+{{< paragraph class="language-java language-py" >}}
+### Try the full example in Playground

Review Comment:
   Was not embedded



##########
website/www/site/content/en/documentation/transforms/python/elementwise/tostring.md:
##########
@@ -73,18 +55,9 @@ into a string delimited by `','`.
 You can specify a different delimiter using the `delimiter` argument.
 The string output will be equivalent to `iterable.join(delimiter)`.
 
-{{< highlight language="py" file="sdks/python/apache_beam/examples/snippets/transforms/elementwise/tostring_iterables.py"
-  notebook="examples/notebooks/documentation/transforms/python/elementwise/tostring" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/tostring_iterables.py" tostring_iterables >}}
-{{< /highlight >}}
-
-{{< paragraph class="notebook-skip" >}}
-Output:
-{{< /paragraph >}}
-
-{{< highlight class="notebook-skip" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/tostring_test.py" plants_csv >}}
-{{< /highlight >}}
+{{< playground height="700px" >}}
+{{< playground_snippet language="py" path="SDK_PYTHON_ToStringIterables" show="tostring_iterables" >}}

Review Comment:
   No output



##########
website/www/site/content/en/documentation/transforms/python/elementwise/tostring.md:
##########
@@ -73,18 +55,9 @@ into a string delimited by `','`.
 You can specify a different delimiter using the `delimiter` argument.
 The string output will be equivalent to `iterable.join(delimiter)`.
 
-{{< highlight language="py" file="sdks/python/apache_beam/examples/snippets/transforms/elementwise/tostring_iterables.py"
-  notebook="examples/notebooks/documentation/transforms/python/elementwise/tostring" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/tostring_iterables.py" tostring_iterables >}}
-{{< /highlight >}}
-
-{{< paragraph class="notebook-skip" >}}
-Output:
-{{< /paragraph >}}
-
-{{< highlight class="notebook-skip" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/tostring_test.py" plants_csv >}}
-{{< /highlight >}}
+{{< playground height="700px" >}}
+{{< playground_snippet language="py" path="SDK_PYTHON_ToStringIterables" show="tostring_iterables" >}}

Review Comment:
   Resolved



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/java/aggregation/count.md:
##########
@@ -39,7 +39,18 @@ transform has three varieties:
   appeared in the original collection.
 
 ## Examples
-See [BEAM-7703](https://issues.apache.org/jira/browse/BEAM-7703) for updates.
+
+**Example 1**:
+
+{{< playground height="700px" >}}
+{{< playground_snippet language="java" path="SDK_JAVA_Count" show="main_section" >}}
+{{< /playground >}}
+
+**Example 2**:

Review Comment:
   **Example 2**: Count.perKey



-- 
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] rshamunov commented on a diff in pull request #26933: Embed examples

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


##########
website/www/site/content/en/documentation/transforms/python/aggregation/min.md:
##########
@@ -32,33 +32,17 @@ Then, we get the element with the minimum value in different ways.
 
 We use `Combine.Globally()` to get the minimum element from the *entire* `PCollection`.
 
-{{< highlight language="py" file="sdks/python/apache_beam/examples/snippets/transforms/aggregation/min_globally.py" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/aggregation/min_globally.py" min_globally >}}
-{{< /highlight >}}
-
-{{< paragraph class="notebook-skip" >}}
-Output:
-{{< /paragraph >}}
-
-{{< highlight class="notebook-skip" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/aggregation/min_test.py" min_element >}}
-{{< /highlight >}}
+{{< playground height="700px" >}}
+{{< playground_snippet language="py" path="SDK_PYTHON_MinGlobally" show="min_globally" >}}
+{{< /playground >}}
 
 ### Example 2: Minimum elements for each key
 
 We use `Combine.PerKey()` to get the minimum element for each unique key in a `PCollection` of key-values.
 
-{{< highlight language="py" file="sdks/python/apache_beam/examples/snippets/transforms/aggregation/min_per_key.py" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/aggregation/min_per_key.py" min_per_key >}}
-{{< /highlight >}}
-
-{{< paragraph class="notebook-skip" >}}
-Output:
-{{< /paragraph >}}
-
-{{< highlight class="notebook-skip" >}}
-{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/aggregation/min_test.py" elements_with_min_value_per_key >}}
-{{< /highlight >}}
+{{< playground height="700px" >}}
+{{< playground_snippet language="py" path="SDK_PYTHON_MaxPerKey" show="min_per_key" >}}

Review Comment:
   MinPerKey



-- 
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] pabloem commented on a diff in pull request #26933: Embed examples

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


##########
learning/tour-of-beam/frontend/lib/pages/tour/widgets/playground.dart:
##########
@@ -57,6 +57,7 @@ class PlaygroundWidget extends StatelessWidget {
         SplitView(
           direction: Axis.vertical,
           first: SnippetEditor(
+            autofocus: true,

Review Comment:
   i think this line triggers the 'scroll directly to playground' bug again?



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