Sxnan opened a new pull request, #409:
URL: https://github.com/apache/flink-agents/pull/409

   <!--
   * Thank you very much for contributing to Flink Agents.
   * Please add the relevant components in the PR title. E.g., [api], 
[runtime], [java], [python], [hotfix], etc.
   -->
   
   <!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. 
-->
   Linked issue: #408
   
   ### Purpose of change
   
   This PR improves the Python Async Execution API by replacing the `yield 
from` pattern with the standard Python `async`/`await` syntax.
   
   ### Tests
   
   - Updated existing unit tests in `test_function.py` and 
`test_local_execution_environment.py`
   - Updated e2e tests (`flink_integration_agent.py`, 
`long_term_memory_test.py`) to use the new async/await syntax
   
   ### API
   
   Yes, this PR changes the public API:
   
   **Before:**
   ```python
   @action(InputEvent)
   @staticmethod
   def my_action(event: Event, ctx: RunnerContext):
       result = yield from ctx.execute_async(slow_function, arg1, arg2)
       ctx.send_event(OutputEvent(output=result))
   ```
   
   **After:**
   ```python
   @action(InputEvent)
   @staticmethod
   async def my_action(event: Event, ctx: RunnerContext):
       result = await ctx.execute_async(slow_function, arg1, arg2)
       ctx.send_event(OutputEvent(output=result))
   ```
   
   ### Documentation
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [x] `doc-needed` <!-- Your PR changes impact docs -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to