mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 12:39:32 +00:00
community[patch]: import flattening fix (#20110)
This PR should make it easier for linters to do type checking and for IDEs to jump to definition of code. See #20050 as a template for this PR. - As a byproduct: Added 3 missed `test_imports`. - Added missed `SolarChat` in to __init___.py Added it into test_import ut. - Added `# type: ignore` to fix linting. It is not clear, why linting errors appear after ^ changes. --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
@@ -96,7 +96,7 @@ class GenericLoader(BaseLoader):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
blob_loader: BlobLoader,
|
||||
blob_loader: BlobLoader, # type: ignore[valid-type]
|
||||
blob_parser: BaseBlobParser,
|
||||
) -> None:
|
||||
"""A generic document loader.
|
||||
@@ -112,7 +112,7 @@ class GenericLoader(BaseLoader):
|
||||
self,
|
||||
) -> Iterator[Document]:
|
||||
"""Load documents lazily. Use this when working at a large scale."""
|
||||
for blob in self.blob_loader.yield_blobs():
|
||||
for blob in self.blob_loader.yield_blobs(): # type: ignore[attr-defined]
|
||||
yield from self.blob_parser.lazy_parse(blob)
|
||||
|
||||
def load_and_split(
|
||||
@@ -159,7 +159,7 @@ class GenericLoader(BaseLoader):
|
||||
Returns:
|
||||
A generic document loader.
|
||||
"""
|
||||
blob_loader = FileSystemBlobLoader(
|
||||
blob_loader = FileSystemBlobLoader( # type: ignore[attr-defined, misc]
|
||||
path,
|
||||
glob=glob,
|
||||
exclude=exclude,
|
||||
|
Reference in New Issue
Block a user