mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-28 01:19:31 +00:00
core[patch]: Update error message in indexing code for unreachable code assertion (#28712)
Minor update for error message that should never be triggered
This commit is contained in:
parent
da28cf1f54
commit
ce90b25313
@ -410,7 +410,10 @@ def index(
|
|||||||
# here due to a check that's happening above, so we check again.
|
# here due to a check that's happening above, so we check again.
|
||||||
for source_id in source_ids:
|
for source_id in source_ids:
|
||||||
if source_id is None:
|
if source_id is None:
|
||||||
msg = "Source ids cannot be None here."
|
msg = (
|
||||||
|
"source_id cannot be None at this point. "
|
||||||
|
"Reached unreachable code."
|
||||||
|
)
|
||||||
raise AssertionError(msg)
|
raise AssertionError(msg)
|
||||||
|
|
||||||
_source_ids = cast(Sequence[str], source_ids)
|
_source_ids = cast(Sequence[str], source_ids)
|
||||||
@ -670,7 +673,10 @@ async def aindex(
|
|||||||
# here due to a check that's happening above, so we check again.
|
# here due to a check that's happening above, so we check again.
|
||||||
for source_id in source_ids:
|
for source_id in source_ids:
|
||||||
if source_id is None:
|
if source_id is None:
|
||||||
msg = "Source ids cannot be None here."
|
msg = (
|
||||||
|
"source_id cannot be None at this point. "
|
||||||
|
"Reached unreachable code."
|
||||||
|
)
|
||||||
raise AssertionError(msg)
|
raise AssertionError(msg)
|
||||||
|
|
||||||
_source_ids = cast(Sequence[str], source_ids)
|
_source_ids = cast(Sequence[str], source_ids)
|
||||||
|
Loading…
Reference in New Issue
Block a user