You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "rakeshcusat (via GitHub)" <gi...@apache.org> on 2025/06/09 06:00:37 UTC

[PR] Update state doc 34905 [beam]

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

   Issue link: https://github.com/apache/beam/issues/34905 
   
   Updated Python State Doc to provide more clarity. 
   
   ------------------------
   
   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://github.com/apache/beam/blob/master/CONTRIBUTING.md#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/actions/workflows/build_wheels.yml/badge.svg?event=schedule&&?branch=master)](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/actions/workflows/python_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/actions/workflows/java_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/actions/workflows/go_tests.yml/badge.svg?event=schedule&&?branch=master)](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 or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
   


-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6621,6 +6621,29 @@ _ = (p | 'Read per user' >> ReadPerUser()
        | 'Set state pardo' >> beam.ParDo(OrderedListStateDoFn()))
 {{< /highlight >}}
 
+#### MultimapState {#multimap-state}
+`MultimapState` allow one key mapped to different values but the key value could be unordered.
+
+{{< highlight java >}}
+
+  @StateId(stateId)
+  private final StateSpec<MultimapState<String, Integer>> multimapState =
+      StateSpecs.multimap(StringUtf8Coder.of(), VarIntCoder.of());

Review Comment:
   Good point, I will take care of this.



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
sdks/python/apache_beam/transforms/userstate.py:
##########
@@ -63,7 +63,7 @@ def to_runner_api(
     raise NotImplementedError
 
 
-class ReadModifyWriteStateSpec(StateSpec):
+class ReadModifyWriteStateSpec(StateSpec):  #TODO: This state is missing from the programming guide.

Review Comment:
   No, this would break anyone using this state spec today



-- 
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: [PR] Update state doc 34905 [beam]

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

   Run Python_Runners PreCommit 3.9


-- 
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: [PR] Update state doc 34905 [beam]

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


##########
sdks/python/apache_beam/transforms/userstate.py:
##########
@@ -63,7 +63,7 @@ def to_runner_api(
     raise NotImplementedError
 
 
-class ReadModifyWriteStateSpec(StateSpec):
+class ReadModifyWriteStateSpec(StateSpec):  #TODO: This state is missing from the programming guide.

Review Comment:
   I think at this point it would probably be more confusion than it is worth IMO. It is odd that it is different, but it has been around for years, and there's not really a reason it is less correct than the Java/Go variants.



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6972,6 +6972,40 @@ Timer output timestamps is not yet supported in Python SDK. See https://github.c
 {{< code_sample "sdks/go/examples/snippets/04transforms.go" timer_output_timestamps_good >}}
 {{< /highlight >}}
 
+
+#### 11.3.5 Timer Callback Parameters {#timer-callback-parameters}
+The following parameters are provided for the timer callback methods which could be used for debuging.
+
+1. Window: This can provide the window object to access the window start and end time.
+2. Timestamp: This can provide the timestamp of the element.

Review Comment:
   lol, I have added this functionality/parameter almost 6 years ago and forgot its details. I should have updated the documentation then.



-- 
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: [PR] Update state doc 34905 [beam]

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

   Run Prism_Python PreCommit 3.9


-- 
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: [PR] Update state doc 34905 [beam]

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

   also ptal at formatter & linter errors. thanks!


-- 
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: [PR] Update state doc 34905 [beam]

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

   ## [Codecov](https://app.codecov.io/gh/apache/beam/pull/35209?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 56.46%. Comparing base [(`d427d37`)](https://app.codecov.io/gh/apache/beam/commit/d427d3731e4653374310d693c5e13933529ac488?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`c312d9e`)](https://app.codecov.io/gh/apache/beam/commit/c312d9e7a2591081132ce1c0d67cb0c505d6203b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 184 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #35209      +/-   ##
   ============================================
   - Coverage     56.49%   56.46%   -0.04%     
     Complexity     3301     3301              
   ============================================
     Files          1182     1189       +7     
     Lines        181610   182012     +402     
     Branches       3409     3409              
   ============================================
   + Hits         102599   102771     +172     
   - Misses        75740    75970     +230     
     Partials       3271     3271              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/beam/pull/35209/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [python](https://app.codecov.io/gh/apache/beam/pull/35209/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.91% <100.00%> (-0.21%)` | :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.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/beam/pull/35209?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6972,6 +6972,40 @@ Timer output timestamps is not yet supported in Python SDK. See https://github.c
 {{< code_sample "sdks/go/examples/snippets/04transforms.go" timer_output_timestamps_good >}}
 {{< /highlight >}}
 
+
+#### 11.3.5 Timer Callback Parameters {#timer-callback-parameters}
+The following parameters are provided for the timer callback methods which could be used for debuging.
+
+1. Window: This can provide the window object to access the window start and end time.
+2. Timestamp: This can provide the timestamp at which the timer was set to fire.
+3. Key: The key was associated with the element.
+
+{{< highlight py >}}

Review Comment:
   Thank you @damccorm , I have incorporated these 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


Re: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6972,6 +6972,40 @@ Timer output timestamps is not yet supported in Python SDK. See https://github.c
 {{< code_sample "sdks/go/examples/snippets/04transforms.go" timer_output_timestamps_good >}}
 {{< /highlight >}}
 
+
+#### 11.3.5 Timer Callback Parameters {#timer-callback-parameters}
+The following parameters are provided for the timer callback methods which could be used for debuging.
+
+1. Window: This can provide the window object to access the window start and end time.
+2. Timestamp: This can provide the timestamp of the element.

Review Comment:
   A timer is not necessarily associated with a single element, I think this is more accurate:
   
   ```suggestion
   2. Timestamp: This can provide the timestamp at which the timer was set to fire.
   ```



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
sdks/python/apache_beam/transforms/userstate.py:
##########
@@ -63,7 +63,7 @@ def to_runner_api(
     raise NotImplementedError
 
 
-class ReadModifyWriteStateSpec(StateSpec):
+class ReadModifyWriteStateSpec(StateSpec):  #TODO: This state is missing from the programming guide.

Review Comment:
   Agreed, lets ignore this then.



-- 
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: [PR] Update state doc 34905 [beam]

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

   Assigning reviewers:
   
   R: @tvalentyn for label python.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
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: [PR] Update state doc 34905 [beam]

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


##########
sdks/python/apache_beam/transforms/userstate.py:
##########
@@ -63,7 +63,7 @@ def to_runner_api(
     raise NotImplementedError
 
 
-class ReadModifyWriteStateSpec(StateSpec):
+class ReadModifyWriteStateSpec(StateSpec):  #TODO: This state is missing from the programming guide.

Review Comment:
   That's right and they may need to upgrade it.
   
   Can we just introduce ValueStateSpec and mark this ReadModifyWriteStateSpec as deprecated? It will not break the older code but moving forward it will be consistent with the other SDKs. 



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6972,6 +6972,40 @@ Timer output timestamps is not yet supported in Python SDK. See https://github.c
 {{< code_sample "sdks/go/examples/snippets/04transforms.go" timer_output_timestamps_good >}}
 {{< /highlight >}}
 
+
+#### 11.3.5 Timer Callback Parameters {#timer-callback-parameters}
+The following parameters are provided for the timer callback methods which could be used for debuging.
+
+1. Window: This can provide the window object to access the window start and end time.
+2. Timestamp: This can provide the timestamp at which the timer was set to fire.
+3. Key: The key was associated with the element.
+
+{{< highlight py >}}

Review Comment:
   Yes, here is an example in java that uses all of these - https://github.com/apache/beam/blob/b43726a4ad2c2661f6e4f01d232ea69655c66aac/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/GroupIntoBatches.java#L631 - and an example in Go - https://github.com/apache/beam/blob/b43726a4ad2c2661f6e4f01d232ea69655c66aac/sdks/go/examples/timer_wordcap/wordcap.go#L85



-- 
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: [PR] Update state doc 34905 [beam]

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


-- 
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: [PR] Update state doc 34905 [beam]

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

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


Re: [PR] Update state doc 34905 [beam]

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


##########
sdks/python/apache_beam/transforms/userstate.py:
##########
@@ -63,7 +63,7 @@ def to_runner_api(
     raise NotImplementedError
 
 
-class ReadModifyWriteStateSpec(StateSpec):
+class ReadModifyWriteStateSpec(StateSpec):  #TODO: This state is missing from the programming guide.

Review Comment:
   @damccorm should we rename this to avoid confusion?



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6972,6 +6972,40 @@ Timer output timestamps is not yet supported in Python SDK. See https://github.c
 {{< code_sample "sdks/go/examples/snippets/04transforms.go" timer_output_timestamps_good >}}
 {{< /highlight >}}
 
+
+#### 11.3.5 Timer Callback Parameters {#timer-callback-parameters}
+The following parameters are provided for the timer callback methods which could be used for debuging.
+
+1. Window: This can provide the window object to access the window start and end time.
+2. Timestamp: This can provide the timestamp at which the timer was set to fire.
+3. Key: The key was associated with the element.
+
+{{< highlight py >}}

Review Comment:
   While browsing the code I also realized that MultiMapState is also missing from the documentation: https://github.com/apache/beam/pull/23491 , This state is only available in Java.
   



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6621,6 +6621,29 @@ _ = (p | 'Read per user' >> ReadPerUser()
        | 'Set state pardo' >> beam.ParDo(OrderedListStateDoFn()))
 {{< /highlight >}}
 
+#### MultimapState {#multimap-state}
+`MultimapState` allow one key mapped to different values but the key value could be unordered.
+
+{{< highlight java >}}
+
+  @StateId(stateId)
+  private final StateSpec<MultimapState<String, Integer>> multimapState =
+      StateSpecs.multimap(StringUtf8Coder.of(), VarIntCoder.of());

Review Comment:
   It looks to me like the formatting might be off - this section has leading tabs while the below version does not.



##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6621,6 +6621,29 @@ _ = (p | 'Read per user' >> ReadPerUser()
        | 'Set state pardo' >> beam.ParDo(OrderedListStateDoFn()))
 {{< /highlight >}}
 
+#### MultimapState {#multimap-state}
+`MultimapState` allow one key mapped to different values but the key value could be unordered.
+
+{{< highlight java >}}
+
+  @StateId(stateId)
+  private final StateSpec<MultimapState<String, Integer>> multimapState =
+      StateSpecs.multimap(StringUtf8Coder.of(), VarIntCoder.of());

Review Comment:
   I think both sections should have tabs



-- 
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: [PR] Update state doc 34905 [beam]

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

   @damccorm Were you thinking something similar? 
   
   There are a couple of more changes which I am going to add:
   1. Update programming doc for missing state(s).
   2. Add section in programming doc for utility function such as passing window, timer and other parameter in the timer callback function.
   
   let me know if you have something else in mind as well.


-- 
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: [PR] Update state doc 34905 [beam]

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


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6972,6 +6972,40 @@ Timer output timestamps is not yet supported in Python SDK. See https://github.c
 {{< code_sample "sdks/go/examples/snippets/04transforms.go" timer_output_timestamps_good >}}
 {{< /highlight >}}
 
+
+#### 11.3.5 Timer Callback Parameters {#timer-callback-parameters}
+The following parameters are provided for the timer callback methods which could be used for debuging.
+
+1. Window: This can provide the window object to access the window start and end time.
+2. Timestamp: This can provide the timestamp at which the timer was set to fire.
+3. Key: The key was associated with the element.
+
+{{< highlight py >}}

Review Comment:
   @damccorm do we have something equivalent in Java or Go? 
   I can update this section in case these SDK has something similar.



-- 
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: [PR] Update state doc 34905 [beam]

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


##########
sdks/python/apache_beam/transforms/userstate.py:
##########
@@ -63,7 +63,7 @@ def to_runner_api(
     raise NotImplementedError
 
 
-class ReadModifyWriteStateSpec(StateSpec):
+class ReadModifyWriteStateSpec(StateSpec):  #TODO: This state is missing from the programming guide.

Review Comment:
   It is actually present - https://beam.apache.org/documentation/programming-guide/#valuestate - it is just under ValueState because it is named differently in Java/Go 😢 



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