future_safe & RuntimeWarning: coroutine '...' was never awaited
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne mit FutureResultE.from_iterable und dem Minimalbeispiel im Issue und untersuche dann returns/_generated/futures/_future_result.py:44 sowie returns/future.py:594, wo die Warnungen auftreten. Reproduziere das Problem mit Python 3.7 und dem fehlschlagenden Timeout-Beispiel; fertig ist es, wenn der erwartete Failure bestehen bleibt, während die unawaited-coroutine RuntimeWarnings nicht mehr erscheinen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hi!
I'm running sample code from https://returns.readthedocs.io/en/latest/pages/future.html#futureresult on python3.7
I've set timeout for AsyncClient to 0.01, expecting the function to always fail. That works correct, the result is <IOResult: <Failure: >>
But there are lots of RuntimeWarnings:
/.../returns/_generated/futures/_future_result.py:44: RuntimeWarning: coroutine 'async_map' was never awaited
container = await inner_value
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/.../returns/_generated/futures/_future_result.py:44: RuntimeWarning: coroutine 'future_safe.<locals>.factory' was never awaited
container = await inner_value
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/.../future.py:594: RuntimeWarning: coroutine 'async_map' was never awaited
return IOResult.from_result(await self._inner_value)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/.../returns/future.py:594: RuntimeWarning: coroutine 'future_safe.<locals>.factory' was never awaited
return IOResult.from_result(await self._inner_value)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
It is not a good idea to disable RuntimeWarnings, and i suspect this behaviour to be incorrect.
I think that the problem is inside the FutureResultE.from_iterable, the minimal working example is like this:
@future_safe
async def f1(x: float) -> float:
return x / 0
def f2() -> FutureResultE[Sequence[float]]:
return FutureResultE.from_iterable(
# changing range(3) -> range(1) removes RuntimeWarnings
[f1(x).map(lambda k: k + 1) for x in range(3)]
)
print(anyio.run(f2().awaitable))
- Vorherrschende Sprache
- Python
- Sterne
- 4.4k
- Forks
- 154
- Ø Merge
- 3 Std. 5 Min.
- Gemergte PRs (30 T.)
- 22
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus dry-python/returns
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
dry-python/returns#2394 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
dry-python/returns#2365 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
dry-python/returns#2355 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
dry-python/returns#2295 · 4 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
dry-python/returns#2253 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in dry-python/returns
Ähnliche Issues
-
correction metadata
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
acl-org/acl-anthology#10104 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug status/needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
prowler-cloud/prowler#12885 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed varianceOffenbug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
selimfirat/pysad#107 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug ci-failure high priority
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
vllm-project/vllm-omni#8194 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag