Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug in which inputs were not working for asynchronous applications #440

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

elijahbenizzy
Copy link
Contributor

@elijahbenizzy elijahbenizzy commented Nov 28, 2024

See #439. We were filing with required inputs twice -- this ensures it only happens once. We were calling _step from _astep, both of which did this.

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

Important

Fixes double input processing in asynchronous applications by adjusting input handling in Application._astep() and adds tests for context and input handling.

  • Behavior:
    • Fixes double processing of inputs in Application._astep() in application.py by ensuring inputs are processed only once.
    • Adjusts input handling logic to prevent redundant processing when calling _step from _astep.
  • Tests:
    • Adds test_app_astep_context() and test_app_step_context() in test_application.py to verify context passing in async and sync steps.
    • Adds test_app_astep_with_inputs() to ensure inputs are correctly handled in async steps.
  • Misc:
    • Minor string formatting fix in application.py.
    • Bumps version in pyproject.toml from 0.33.2 to 0.33.3.

This description was created by Ellipsis for 7124276. It will automatically update as commits are pushed.

See #439. We were filing with required inputs twice -- this ensures it
only happens once. We were calling _step from _astep, both of which did
this.
@elijahbenizzy elijahbenizzy marked this pull request as ready for review November 28, 2024 02:26
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 5f20105 in 23 seconds

More details
  • Looked at 113 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. burr/core/application.py:965
  • Draft comment:
    The comment here suggests launching a thread for non-async actions in an async context. This is generally unsafe and should be avoided unless absolutely necessary. Consider removing this comment or providing a safer alternative.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description indicates that the change is to prevent double processing of inputs in asynchronous applications. The code change in _astep reflects this by ensuring inputs are processed only once. The test cases added seem to verify the context passing in both synchronous and asynchronous steps, which aligns with the change.

Workflow ID: wflow_VycPyIUuAcT1HOwN


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

github-actions bot commented Nov 28, 2024

A preview of 7124276 is uploaded and can be seen here:

https://burr.dagworks.io/pull/440

Changes may take a few minutes to propagate. Since this is a preview of production, content with draft: true will not be rendered. The source is here: https://github.com/DAGWorks-Inc/burr/tree/gh-pages/pull/440/

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 7124276 in 15 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_2mzIUSDXd8NkwIqj


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@elijahbenizzy elijahbenizzy merged commit afc0fc0 into main Nov 28, 2024
11 checks passed
@elijahbenizzy elijahbenizzy deleted the async-inputs-bug branch November 28, 2024 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants