docs: fix inaccurate statement about nested asyncio loop support#1822
docs: fix inaccurate statement about nested asyncio loop support#1822octo-patch wants to merge 1 commit into
Conversation
NVIDIA-NeMo#1445) The troubleshooting doc incorrectly stated that Python core team would "most likely" add support for nested event loops. Both the referenced CPython issue (#66435, 11 years old) and PR (#93338, 3 years old) are closed without action, indicating support will not be added. Co-Authored-By: Octopus <liyuan851277048@icloud.com> Signed-off-by: octo-patch <octo-patch@github.com>
Greptile SummaryThis PR corrects a factual error in the troubleshooting documentation: the statement that Python's
|
| Filename | Overview |
|---|---|
| docs/troubleshooting.md | Documentation-only fix: corrects inaccurate claim about nested asyncio loop support being added in CPython — changed "will be added" to "will not be added" to reflect the closed CPython issue and PR. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Caller uses blocking API] --> B[nemoguardrails sync wrapper]
B --> C{nest_asyncio patched?}
C -- Yes --> D[asyncio.run in existing loop\nvia nest_asyncio]
C -- No / DISABLE_NEST_ASYNCIO=True --> E[asyncio.run fails\nRuntimeError: nested event loop]
D --> F[Async core logic executes]
E --> G[Caller must use async API directly]
Reviews (1): Last reviewed commit: "docs: fix inaccurate statement about nes..." | Re-trigger Greptile
Documentation preview |
📝 WalkthroughWalkthroughA single documentation update in the troubleshooting guide clarifies that Python will not add support for nested event loops, correcting a previous statement that suggested support would "most likely" be added. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/troubleshooting.md`:
- Line 7: Update the sentence phrasing from present continuous to past tense to
reflect the closed status of the CPython discussion: replace "is being discussed
by the Python core team" with "was discussed by the Python core team" (and
optionally change "most likely, support will not be added" to "support was
deemed unlikely" or similar) in the paragraph that references "support will not
be added" and the GitHub issue/PR numbers so the tense is consistent with the
closed issue.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2f7e6715-b65d-4579-91a4-cd7e641f5399
📒 Files selected for processing (1)
docs/troubleshooting.md
| ## Nested AsyncIO Loop | ||
|
|
||
| NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue is being discussed by the Python core team and, most likely, support will be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)). | ||
| NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue is being discussed by the Python core team and, most likely, support will not be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)). |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check the status of CPython issue `#66435` and PR `#93338`
echo "Checking CPython issue `#66435`..."
gh api repos/python/cpython/issues/66435 --jq '{state: .state, closed_at: .closed_at, title: .title}'
echo -e "\nChecking CPython PR `#93338`..."
gh api repos/python/cpython/pulls/93338 --jq '{state: .state, closed_at: .closed_at, merged: .merged, title: .title}'Repository: NVIDIA-NeMo/Guardrails
Length of output: 335
Update tense for consistency with closed issue status.
The statement "support will not be added" is factually accurate—the referenced CPython issue #66435 and PR #93338 are both closed (as of March 2024), with the PR not merged. However, the sentence uses present continuous tense ("is being discussed") which contradicts the closed status. Change to past tense for consistency:
-This issue is being discussed by the Python core team and, most likely, support will not be added
+This issue was discussed by the Python core team and, most likely, support will not be added📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue is being discussed by the Python core team and, most likely, support will not be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)). | |
| NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue was discussed by the Python core team and, most likely, support will not be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)). |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/troubleshooting.md` at line 7, Update the sentence phrasing from present
continuous to past tense to reflect the closed status of the CPython discussion:
replace "is being discussed by the Python core team" with "was discussed by the
Python core team" (and optionally change "most likely, support will not be
added" to "support was deemed unlikely" or similar) in the paragraph that
references "support will not be added" and the GitHub issue/PR numbers so the
tense is consistent with the closed issue.
a6be550 to
c69efe5
Compare
Fixes #1445
Problem
The troubleshooting documentation incorrectly stated:
However, both the referenced CPython issue (#66435, 11 years old) and the PR (#93338, 3 years old) have been closed without adding support for nested event loops. The statement should reflect that support will not be added.
Solution
Changed "support will be added" to "support will not be added" to accurately reflect the current state of the CPython discussion and the closed references.
Testing
Documentation-only change; no code is affected.
Signed-off-by: Octopus liyuan851277048@icloud.com
Summary by CodeRabbit