diff --git a/libs/community/langchain_community/document_loaders/acreom.py b/libs/community/langchain_community/document_loaders/acreom.py index 618883270da..b6eccfeac0b 100644 --- a/libs/community/langchain_community/document_loaders/acreom.py +++ b/libs/community/langchain_community/document_loaders/acreom.py @@ -1,6 +1,6 @@ import re from pathlib import Path -from typing import Iterator, List +from typing import Iterator from langchain_core.documents import Document @@ -74,6 +74,3 @@ def lazy_load(self) -> Iterator[Document]: } yield Document(page_content=text, metadata=metadata) - - def load(self) -> List[Document]: - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/airbyte.py b/libs/community/langchain_community/document_loaders/airbyte.py index a9609c55b64..323c37fc35d 100644 --- a/libs/community/langchain_community/document_loaders/airbyte.py +++ b/libs/community/langchain_community/document_loaders/airbyte.py @@ -1,4 +1,4 @@ -from typing import Any, Callable, Iterator, List, Mapping, Optional +from typing import Any, Callable, Iterator, Mapping, Optional from langchain_core.documents import Document from langchain_core.utils.utils import guard_import @@ -53,9 +53,6 @@ def _handle_record( self._stream_name = stream_name self._state = state - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: return self._integration._load_data( stream_name=self._stream_name, state=self._state diff --git a/libs/community/langchain_community/document_loaders/airtable.py b/libs/community/langchain_community/document_loaders/airtable.py index 1ca7fb1de92..c39ed1fe630 100644 --- a/libs/community/langchain_community/document_loaders/airtable.py +++ b/libs/community/langchain_community/document_loaders/airtable.py @@ -1,4 +1,4 @@ -from typing import Iterator, List +from typing import Iterator from langchain_core.documents import Document @@ -34,7 +34,3 @@ def lazy_load(self) -> Iterator[Document]: "table_id": self.table_id, }, ) - - def load(self) -> List[Document]: - """Load Documents from table.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/arcgis_loader.py b/libs/community/langchain_community/document_loaders/arcgis_loader.py index 24264b0add7..d927f35e126 100644 --- a/libs/community/langchain_community/document_loaders/arcgis_loader.py +++ b/libs/community/langchain_community/document_loaders/arcgis_loader.py @@ -148,7 +148,3 @@ def lazy_load(self) -> Iterator[Document]: ) yield Document(page_content=page_content, metadata=metadata) - - def load(self) -> List[Document]: - """Load all records from FeatureLayer.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/astradb.py b/libs/community/langchain_community/document_loaders/astradb.py index 976b4a70da9..5f1b82cc429 100644 --- a/libs/community/langchain_community/document_loaders/astradb.py +++ b/libs/community/langchain_community/document_loaders/astradb.py @@ -76,9 +76,6 @@ def __init__( self.nb_prefetched = nb_prefetched self.extraction_function = extraction_function - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: for doc in self.collection.paginated_find( filter=self.filter, diff --git a/libs/community/langchain_community/document_loaders/athena.py b/libs/community/langchain_community/document_loaders/athena.py index e3ed42e44db..2fcfc9b393a 100644 --- a/libs/community/langchain_community/document_loaders/athena.py +++ b/libs/community/langchain_community/document_loaders/athena.py @@ -157,7 +157,3 @@ def lazy_load(self) -> Iterator[Document]: } doc = Document(page_content=page_content, metadata=metadata) yield doc - - def load(self) -> List[Document]: - """Load data into document objects.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/azure_ai_data.py b/libs/community/langchain_community/document_loaders/azure_ai_data.py index 77ac93d3e07..05f404ddd13 100644 --- a/libs/community/langchain_community/document_loaders/azure_ai_data.py +++ b/libs/community/langchain_community/document_loaders/azure_ai_data.py @@ -1,4 +1,4 @@ -from typing import Iterator, List, Optional +from typing import Iterator, Optional from langchain_community.docstore.document import Document from langchain_community.document_loaders.base import BaseLoader @@ -16,10 +16,6 @@ def __init__(self, url: str, glob: Optional[str] = None): self.glob_pattern = glob """Optional glob pattern to select files. Defaults to None.""" - def load(self) -> List[Document]: - """Load documents.""" - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """A lazy loader for Documents.""" try: diff --git a/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py b/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py index 05e41fbaaa8..c069c24f9b8 100644 --- a/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py +++ b/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py @@ -1,4 +1,4 @@ -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -18,9 +18,6 @@ def __init__(self, conf: Any, bucket: str, prefix: str = ""): self.bucket = bucket self.prefix = prefix - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """Load documents.""" try: diff --git a/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py b/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py index 4f853ba3ddf..dca4cd544f1 100644 --- a/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py +++ b/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py @@ -1,7 +1,7 @@ import logging import os import tempfile -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -24,9 +24,6 @@ def __init__(self, conf: Any, bucket: str, key: str): self.bucket = bucket self.key = key - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """Load documents.""" try: diff --git a/libs/community/langchain_community/document_loaders/bibtex.py b/libs/community/langchain_community/document_loaders/bibtex.py index 1cae90b8d83..49f9c6b2dbe 100644 --- a/libs/community/langchain_community/document_loaders/bibtex.py +++ b/libs/community/langchain_community/document_loaders/bibtex.py @@ -96,16 +96,3 @@ def lazy_load(self) -> Iterator[Document]: doc = self._load_entry(entry) if doc: yield doc - - def load(self) -> List[Document]: - """Load bibtex file documents from the given bibtex file path. - - See https://bibtexparser.readthedocs.io/en/master/ - - Args: - file_path: the path to the bibtex file - - Returns: - a list of documents with the document.page_content in text format - """ - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/browserless.py b/libs/community/langchain_community/document_loaders/browserless.py index 03d8dcec9ad..3a315be44b4 100644 --- a/libs/community/langchain_community/document_loaders/browserless.py +++ b/libs/community/langchain_community/document_loaders/browserless.py @@ -61,7 +61,3 @@ def lazy_load(self) -> Iterator[Document]: "source": url, }, ) - - def load(self) -> List[Document]: - """Load Documents from URLs.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/cassandra.py b/libs/community/langchain_community/document_loaders/cassandra.py index 3cef56a1cbc..cc2e8f7d620 100644 --- a/libs/community/langchain_community/document_loaders/cassandra.py +++ b/libs/community/langchain_community/document_loaders/cassandra.py @@ -5,7 +5,6 @@ Any, Callable, Iterator, - List, Optional, Sequence, Union, @@ -106,9 +105,6 @@ def __init__( if query_execution_profile is not _NOT_SET: self.query_kwargs["execution_profile"] = query_execution_profile - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: for row in self.session.execute(self.query, **self.query_kwargs): metadata = self.metadata.copy() diff --git a/libs/community/langchain_community/document_loaders/chromium.py b/libs/community/langchain_community/document_loaders/chromium.py index 7af99aed26a..668466a7ff5 100644 --- a/libs/community/langchain_community/document_loaders/chromium.py +++ b/libs/community/langchain_community/document_loaders/chromium.py @@ -78,14 +78,3 @@ def lazy_load(self) -> Iterator[Document]: html_content = asyncio.run(self.ascrape_playwright(url)) metadata = {"source": url} yield Document(page_content=html_content, metadata=metadata) - - def load(self) -> List[Document]: - """ - Load and return all Documents from the provided URLs. - - Returns: - List[Document]: A list of Document objects - containing the scraped content from each URL. - - """ - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/couchbase.py b/libs/community/langchain_community/document_loaders/couchbase.py index fabc0a73987..5d89016202b 100644 --- a/libs/community/langchain_community/document_loaders/couchbase.py +++ b/libs/community/langchain_community/document_loaders/couchbase.py @@ -68,10 +68,6 @@ def __init__( self.page_content_fields = page_content_fields self.metadata_fields = metadata_fields - def load(self) -> List[Document]: - """Load Couchbase data into Document objects.""" - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """Load Couchbase data into Document objects lazily.""" from datetime import timedelta diff --git a/libs/community/langchain_community/document_loaders/dataframe.py b/libs/community/langchain_community/document_loaders/dataframe.py index 848f4d9d075..744185f053d 100644 --- a/libs/community/langchain_community/document_loaders/dataframe.py +++ b/libs/community/langchain_community/document_loaders/dataframe.py @@ -1,4 +1,4 @@ -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -26,10 +26,6 @@ def lazy_load(self) -> Iterator[Document]: metadata.pop(self.page_content_column) yield Document(page_content=text, metadata=metadata) - def load(self) -> List[Document]: - """Load full dataframe.""" - return list(self.lazy_load()) - class DataFrameLoader(BaseDataFrameLoader): """Load `Pandas` DataFrame.""" diff --git a/libs/community/langchain_community/document_loaders/doc_intelligence.py b/libs/community/langchain_community/document_loaders/doc_intelligence.py index 2aae5212a59..e0fc1894054 100644 --- a/libs/community/langchain_community/document_loaders/doc_intelligence.py +++ b/libs/community/langchain_community/document_loaders/doc_intelligence.py @@ -1,4 +1,4 @@ -from typing import Iterator, List, Optional +from typing import Iterator, Optional from langchain_core.documents import Document @@ -77,10 +77,6 @@ def __init__( mode=mode, ) - def load(self) -> List[Document]: - """Load given path as pages.""" - return list(self.lazy_load()) - def lazy_load( self, ) -> Iterator[Document]: diff --git a/libs/community/langchain_community/document_loaders/etherscan.py b/libs/community/langchain_community/document_loaders/etherscan.py index eb057b4b604..ff78aa90a91 100644 --- a/libs/community/langchain_community/document_loaders/etherscan.py +++ b/libs/community/langchain_community/document_loaders/etherscan.py @@ -71,10 +71,6 @@ def lazy_load(self) -> Iterator[Document]: for doc in result: yield doc - def load(self) -> List[Document]: - """Load transactions from spcifc account by Etherscan.""" - return list(self.lazy_load()) - def getNormTx(self) -> List[Document]: url = ( f"https://api.etherscan.io/api?module=account&action=txlist&address={self.account_address}" diff --git a/libs/community/langchain_community/document_loaders/fauna.py b/libs/community/langchain_community/document_loaders/fauna.py index 5b17216dc00..bbfda737850 100644 --- a/libs/community/langchain_community/document_loaders/fauna.py +++ b/libs/community/langchain_community/document_loaders/fauna.py @@ -1,4 +1,4 @@ -from typing import Iterator, List, Optional, Sequence +from typing import Iterator, Optional, Sequence from langchain_core.documents import Document @@ -28,9 +28,6 @@ def __init__( self.secret = secret self.metadata_fields = metadata_fields - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: try: from fauna import Page, fql diff --git a/libs/community/langchain_community/document_loaders/generic.py b/libs/community/langchain_community/document_loaders/generic.py index 1573ec5c478..191149618b1 100644 --- a/libs/community/langchain_community/document_loaders/generic.py +++ b/libs/community/langchain_community/document_loaders/generic.py @@ -115,10 +115,6 @@ def lazy_load( for blob in self.blob_loader.yield_blobs(): yield from self.blob_parser.lazy_parse(blob) - def load(self) -> List[Document]: - """Load all documents.""" - return list(self.lazy_load()) - def load_and_split( self, text_splitter: Optional[TextSplitter] = None ) -> List[Document]: diff --git a/libs/community/langchain_community/document_loaders/geodataframe.py b/libs/community/langchain_community/document_loaders/geodataframe.py index 09a4c5ae9f9..3f867fef233 100644 --- a/libs/community/langchain_community/document_loaders/geodataframe.py +++ b/libs/community/langchain_community/document_loaders/geodataframe.py @@ -1,4 +1,4 @@ -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -67,7 +67,3 @@ def lazy_load(self) -> Iterator[Document]: # using WKT instead of str() to help GIS system interoperability yield Document(page_content=geom.wkt, metadata=metadata) - - def load(self) -> List[Document]: - """Load full dataframe.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/github.py b/libs/community/langchain_community/document_loaders/github.py index 65f327d948f..e2d9269aa93 100644 --- a/libs/community/langchain_community/document_loaders/github.py +++ b/libs/community/langchain_community/document_loaders/github.py @@ -127,32 +127,6 @@ def lazy_load(self) -> Iterator[Document]: else: url = None - def load(self) -> List[Document]: - """ - Get issues of a GitHub repository. - - Returns: - A list of Documents with attributes: - - page_content - - metadata - - url - - title - - creator - - created_at - - last_update_time - - closed_time - - number of comments - - state - - labels - - assignee - - assignees - - milestone - - locked - - number - - is_pull_request - """ - return list(self.lazy_load()) - def parse_issue(self, issue: dict) -> Document: """Create Document objects from a list of GitHub issues.""" metadata = { diff --git a/libs/community/langchain_community/document_loaders/hugging_face_dataset.py b/libs/community/langchain_community/document_loaders/hugging_face_dataset.py index 77841e56a79..4aafc42b681 100644 --- a/libs/community/langchain_community/document_loaders/hugging_face_dataset.py +++ b/libs/community/langchain_community/document_loaders/hugging_face_dataset.py @@ -1,5 +1,5 @@ import json -from typing import Iterator, List, Mapping, Optional, Sequence, Union +from typing import Iterator, Mapping, Optional, Sequence, Union from langchain_core.documents import Document @@ -84,10 +84,6 @@ def lazy_load( for row in dataset[key] ) - def load(self) -> List[Document]: - """Load documents.""" - return list(self.lazy_load()) - def parse_obj(self, page_content: Union[str, object]) -> str: if isinstance(page_content, object): return json.dumps(page_content) diff --git a/libs/community/langchain_community/document_loaders/hugging_face_model.py b/libs/community/langchain_community/document_loaders/hugging_face_model.py index 07dec204ff7..4486a49a2e9 100644 --- a/libs/community/langchain_community/document_loaders/hugging_face_model.py +++ b/libs/community/langchain_community/document_loaders/hugging_face_model.py @@ -106,7 +106,3 @@ def lazy_load(self) -> Iterator[Document]: page_content=readme_content, metadata=model, ) - - def load(self) -> List[Document]: - """Load model information, including README content.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/joplin.py b/libs/community/langchain_community/document_loaders/joplin.py index 50a19f14059..407af7e6a35 100644 --- a/libs/community/langchain_community/document_loaders/joplin.py +++ b/libs/community/langchain_community/document_loaders/joplin.py @@ -91,6 +91,3 @@ def _convert_date(self, date: int) -> str: def lazy_load(self) -> Iterator[Document]: yield from self._get_notes() - - def load(self) -> List[Document]: - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/larksuite.py b/libs/community/langchain_community/document_loaders/larksuite.py index 5e6e2787355..1ab61a9845e 100644 --- a/libs/community/langchain_community/document_loaders/larksuite.py +++ b/libs/community/langchain_community/document_loaders/larksuite.py @@ -1,6 +1,6 @@ import json import urllib.request -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -46,7 +46,3 @@ def lazy_load(self) -> Iterator[Document]: "title": metadata_json["data"]["document"]["title"], } yield Document(page_content=text, metadata=metadata) - - def load(self) -> List[Document]: - """Load LarkSuite (FeiShu) document.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/max_compute.py b/libs/community/langchain_community/document_loaders/max_compute.py index b5cadbbaf92..4b507da89c9 100644 --- a/libs/community/langchain_community/document_loaders/max_compute.py +++ b/libs/community/langchain_community/document_loaders/max_compute.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Iterator, List, Optional, Sequence +from typing import Any, Iterator, Optional, Sequence from langchain_core.documents import Document @@ -78,6 +78,3 @@ def lazy_load(self) -> Iterator[Document]: else: metadata = {k: v for k, v in row.items() if k not in page_content_data} yield Document(page_content=page_content, metadata=metadata) - - def load(self) -> List[Document]: - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/mediawikidump.py b/libs/community/langchain_community/document_loaders/mediawikidump.py index 6d0f1d0e42f..288312d6c9c 100644 --- a/libs/community/langchain_community/document_loaders/mediawikidump.py +++ b/libs/community/langchain_community/document_loaders/mediawikidump.py @@ -1,6 +1,6 @@ import logging from pathlib import Path -from typing import Iterator, List, Optional, Sequence, Union +from typing import Iterator, Optional, Sequence, Union from langchain_core.documents import Document @@ -87,11 +87,6 @@ def _load_single_page_from_dump(self, page) -> Document: # type: ignore[no-unty metadata = {"source": page.title} return Document(page_content=text, metadata=metadata) - def load(self) -> List[Document]: - """Load from a file path.""" - - return [doc for doc in self.lazy_load()] - def lazy_load( self, ) -> Iterator[Document]: diff --git a/libs/community/langchain_community/document_loaders/merge.py b/libs/community/langchain_community/document_loaders/merge.py index 9ef1a0fd3c1..41f79e53f41 100644 --- a/libs/community/langchain_community/document_loaders/merge.py +++ b/libs/community/langchain_community/document_loaders/merge.py @@ -23,10 +23,6 @@ def lazy_load(self) -> Iterator[Document]: for document in data: yield document - def load(self) -> List[Document]: - """Load docs.""" - return list(self.lazy_load()) - async def alazy_load(self) -> AsyncIterator[Document]: """Lazy load docs from each individual loader.""" for loader in self.loaders: diff --git a/libs/community/langchain_community/document_loaders/onedrive.py b/libs/community/langchain_community/document_loaders/onedrive.py index 3d899d0941f..4c769c364d3 100644 --- a/libs/community/langchain_community/document_loaders/onedrive.py +++ b/libs/community/langchain_community/document_loaders/onedrive.py @@ -91,7 +91,3 @@ def lazy_load(self) -> Iterator[Document]: if self.object_ids: for blob in self._load_from_object_ids(drive, self.object_ids): yield from blob_parser.lazy_parse(blob) - - def load(self) -> List[Document]: - """Load all documents.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/onenote.py b/libs/community/langchain_community/document_loaders/onenote.py index 6e3c6cd0977..87c5d78daf9 100644 --- a/libs/community/langchain_community/document_loaders/onenote.py +++ b/libs/community/langchain_community/document_loaders/onenote.py @@ -109,18 +109,6 @@ def lazy_load(self) -> Iterator[Document]: else: request_url = "" - def load(self) -> List[Document]: - """ - Get pages from OneNote notebooks. - - Returns: - A list of Documents with attributes: - - page_content - - metadata - - title - """ - return list(self.lazy_load()) - def _get_page_content(self, page_id: str) -> str: """Get page content from OneNote API""" request_url = self.onenote_api_base_url + f"/pages/{page_id}/content" diff --git a/libs/community/langchain_community/document_loaders/open_city_data.py b/libs/community/langchain_community/document_loaders/open_city_data.py index ad75421bd38..4c0c1a53c76 100644 --- a/libs/community/langchain_community/document_loaders/open_city_data.py +++ b/libs/community/langchain_community/document_loaders/open_city_data.py @@ -1,4 +1,4 @@ -from typing import Iterator, List +from typing import Iterator from langchain_core.documents import Document @@ -37,8 +37,3 @@ def lazy_load(self) -> Iterator[Document]: "source": self.city_id + "_" + self.dataset_id, }, ) - - def load(self) -> List[Document]: - """Load records.""" - - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/pdf.py b/libs/community/langchain_community/document_loaders/pdf.py index ea086054110..c71fbbdab8c 100644 --- a/libs/community/langchain_community/document_loaders/pdf.py +++ b/libs/community/langchain_community/document_loaders/pdf.py @@ -157,10 +157,6 @@ def __init__( super().__init__(file_path, headers=headers) self.parser = PyPDFParser(password=password, extract_images=extract_images) - def load(self) -> List[Document]: - """Load given path as pages.""" - return list(self.lazy_load()) - def lazy_load( self, ) -> Iterator[Document]: diff --git a/libs/community/langchain_community/document_loaders/pubmed.py b/libs/community/langchain_community/document_loaders/pubmed.py index de47787d7bb..892d93affe3 100644 --- a/libs/community/langchain_community/document_loaders/pubmed.py +++ b/libs/community/langchain_community/document_loaders/pubmed.py @@ -1,4 +1,4 @@ -from typing import Iterator, List, Optional +from typing import Iterator, Optional from langchain_core.documents import Document @@ -32,9 +32,6 @@ def __init__( top_k_results=load_max_docs, ) - def load(self) -> List[Document]: - return list(self._client.lazy_load_docs(self.query)) - def lazy_load(self) -> Iterator[Document]: for doc in self._client.lazy_load_docs(self.query): yield doc diff --git a/libs/community/langchain_community/document_loaders/readthedocs.py b/libs/community/langchain_community/document_loaders/readthedocs.py index aee16bab6d7..2a0f11f1e3c 100644 --- a/libs/community/langchain_community/document_loaders/readthedocs.py +++ b/libs/community/langchain_community/document_loaders/readthedocs.py @@ -84,10 +84,6 @@ def lazy_load(self) -> Iterator[Document]: text = self._clean_data(f.read()) yield Document(page_content=text, metadata={"source": str(p)}) - def load(self) -> List[Document]: - """Load documents.""" - return list(self.lazy_load()) - def _clean_data(self, data: str) -> str: from bs4 import BeautifulSoup diff --git a/libs/community/langchain_community/document_loaders/recursive_url_loader.py b/libs/community/langchain_community/document_loaders/recursive_url_loader.py index 08887659841..4d3a6019143 100644 --- a/libs/community/langchain_community/document_loaders/recursive_url_loader.py +++ b/libs/community/langchain_community/document_loaders/recursive_url_loader.py @@ -314,7 +314,3 @@ def lazy_load(self) -> Iterator[Document]: return iter(results or []) else: return self._get_child_links_recursive(self.url, visited) - - def load(self) -> List[Document]: - """Load web pages.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/rocksetdb.py b/libs/community/langchain_community/document_loaders/rocksetdb.py index a1783bc552d..6e7827cd8df 100644 --- a/libs/community/langchain_community/document_loaders/rocksetdb.py +++ b/libs/community/langchain_community/document_loaders/rocksetdb.py @@ -100,9 +100,6 @@ def __init__( # ignore pass - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: query_results = self.client.Queries.query( sql=self.query diff --git a/libs/community/langchain_community/document_loaders/rspace.py b/libs/community/langchain_community/document_loaders/rspace.py index cbac4f52e6b..cb12c6d6c84 100644 --- a/libs/community/langchain_community/document_loaders/rspace.py +++ b/libs/community/langchain_community/document_loaders/rspace.py @@ -124,6 +124,3 @@ def lazy_load(self) -> Iterator[Document]: yield d else: raise ValueError("Unknown global ID type") - - def load(self) -> List[Document]: - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/sharepoint.py b/libs/community/langchain_community/document_loaders/sharepoint.py index 211760fe3f8..ff84c643052 100644 --- a/libs/community/langchain_community/document_loaders/sharepoint.py +++ b/libs/community/langchain_community/document_loaders/sharepoint.py @@ -54,7 +54,3 @@ def lazy_load(self) -> Iterator[Document]: if self.object_ids: for blob in self._load_from_object_ids(drive, self.object_ids): yield from blob_parser.lazy_parse(blob) - - def load(self) -> List[Document]: - """Load all documents.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/snowflake_loader.py b/libs/community/langchain_community/document_loaders/snowflake_loader.py index b37926b5e0d..3081a7b7166 100644 --- a/libs/community/langchain_community/document_loaders/snowflake_loader.py +++ b/libs/community/langchain_community/document_loaders/snowflake_loader.py @@ -122,7 +122,3 @@ def lazy_load(self) -> Iterator[Document]: metadata = {k: v for k, v in row.items() if k in metadata_columns} doc = Document(page_content=page_content, metadata=metadata) yield doc - - def load(self) -> List[Document]: - """Load data into document objects.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/sql_database.py b/libs/community/langchain_community/document_loaders/sql_database.py index 91c1a37684c..c3ab2e4cc91 100644 --- a/libs/community/langchain_community/document_loaders/sql_database.py +++ b/libs/community/langchain_community/document_loaders/sql_database.py @@ -104,9 +104,6 @@ def lazy_load(self) -> Iterator[Document]: yield Document(page_content=page_content, metadata=metadata) - def load(self) -> List[Document]: - return list(self.lazy_load()) - @staticmethod def page_content_default_mapper( row: sa.RowMapping, column_names: Optional[List[str]] = None diff --git a/libs/community/langchain_community/document_loaders/tencent_cos_directory.py b/libs/community/langchain_community/document_loaders/tencent_cos_directory.py index b58bfb674ff..e62bbbead28 100644 --- a/libs/community/langchain_community/document_loaders/tencent_cos_directory.py +++ b/libs/community/langchain_community/document_loaders/tencent_cos_directory.py @@ -1,4 +1,4 @@ -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -19,9 +19,6 @@ def __init__(self, conf: Any, bucket: str, prefix: str = ""): self.bucket = bucket self.prefix = prefix - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """Load documents.""" try: diff --git a/libs/community/langchain_community/document_loaders/tencent_cos_file.py b/libs/community/langchain_community/document_loaders/tencent_cos_file.py index bf9678b981b..4ad71d2579d 100644 --- a/libs/community/langchain_community/document_loaders/tencent_cos_file.py +++ b/libs/community/langchain_community/document_loaders/tencent_cos_file.py @@ -1,6 +1,6 @@ import os import tempfile -from typing import Any, Iterator, List +from typing import Any, Iterator from langchain_core.documents import Document @@ -21,9 +21,6 @@ def __init__(self, conf: Any, bucket: str, key: str): self.bucket = bucket self.key = key - def load(self) -> List[Document]: - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """Load documents.""" try: diff --git a/libs/community/langchain_community/document_loaders/tensorflow_datasets.py b/libs/community/langchain_community/document_loaders/tensorflow_datasets.py index 87dad82e648..07f6510fad4 100644 --- a/libs/community/langchain_community/document_loaders/tensorflow_datasets.py +++ b/libs/community/langchain_community/document_loaders/tensorflow_datasets.py @@ -1,4 +1,4 @@ -from typing import Callable, Dict, Iterator, List, Optional +from typing import Callable, Dict, Iterator, Optional from langchain_core.documents import Document @@ -75,6 +75,3 @@ def __init__( def lazy_load(self) -> Iterator[Document]: yield from self._tfds_client.lazy_load() - - def load(self) -> List[Document]: - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/tidb.py b/libs/community/langchain_community/document_loaders/tidb.py index 0cbf4e77e17..d4e1ba39ba9 100644 --- a/libs/community/langchain_community/document_loaders/tidb.py +++ b/libs/community/langchain_community/document_loaders/tidb.py @@ -65,7 +65,3 @@ def lazy_load(self) -> Iterator[Document]: ) metadata = {col: row_data[col] for col in self.metadata_columns} yield Document(page_content=page_content, metadata=metadata) - - def load(self) -> List[Document]: - """Load TiDB data into document objects.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/tomarkdown.py b/libs/community/langchain_community/document_loaders/tomarkdown.py index ee384f81327..0ac36b5aeb8 100644 --- a/libs/community/langchain_community/document_loaders/tomarkdown.py +++ b/libs/community/langchain_community/document_loaders/tomarkdown.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Iterator, List +from typing import Iterator import requests from langchain_core.documents import Document @@ -28,7 +28,3 @@ def lazy_load( text = response.json()["article"] metadata = {"source": self.url} yield Document(page_content=text, metadata=metadata) - - def load(self) -> List[Document]: - """Load file.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/toml.py b/libs/community/langchain_community/document_loaders/toml.py index 34d7ccfbfeb..16cd5decb5d 100644 --- a/libs/community/langchain_community/document_loaders/toml.py +++ b/libs/community/langchain_community/document_loaders/toml.py @@ -1,6 +1,6 @@ import json from pathlib import Path -from typing import Iterator, List, Union +from typing import Iterator, Union from langchain_core.documents import Document @@ -18,10 +18,6 @@ def __init__(self, source: Union[str, Path]): """Initialize the TomlLoader with a source file or directory.""" self.source = Path(source) - def load(self) -> List[Document]: - """Load and return all documents.""" - return list(self.lazy_load()) - def lazy_load(self) -> Iterator[Document]: """Lazily load the TOML documents from the source file or directory.""" import tomli diff --git a/libs/community/langchain_community/document_loaders/weather.py b/libs/community/langchain_community/document_loaders/weather.py index a2ca0a7d520..51b1f27cd3f 100644 --- a/libs/community/langchain_community/document_loaders/weather.py +++ b/libs/community/langchain_community/document_loaders/weather.py @@ -2,7 +2,7 @@ from __future__ import annotations from datetime import datetime -from typing import Iterator, List, Optional, Sequence +from typing import Iterator, Optional, Sequence from langchain_core.documents import Document @@ -43,9 +43,3 @@ def lazy_load( metadata = {"queried_at": datetime.now()} content = self.client.run(place) yield Document(page_content=content, metadata=metadata) - - def load( - self, - ) -> List[Document]: - """Load weather data for the given locations.""" - return list(self.lazy_load()) diff --git a/libs/community/langchain_community/document_loaders/web_base.py b/libs/community/langchain_community/document_loaders/web_base.py index daf69b14129..2d5bf1a8e74 100644 --- a/libs/community/langchain_community/document_loaders/web_base.py +++ b/libs/community/langchain_community/document_loaders/web_base.py @@ -251,10 +251,6 @@ def lazy_load(self) -> Iterator[Document]: metadata = _build_metadata(soup, path) yield Document(page_content=text, metadata=metadata) - def load(self) -> List[Document]: - """Load text from the url(s) in web_path.""" - return list(self.lazy_load()) - def aload(self) -> List[Document]: """Load text from the urls in web_path async into Documents.""" diff --git a/libs/langchain/tests/unit_tests/indexes/test_indexing.py b/libs/langchain/tests/unit_tests/indexes/test_indexing.py index 59ab527543b..4d939815e39 100644 --- a/libs/langchain/tests/unit_tests/indexes/test_indexing.py +++ b/libs/langchain/tests/unit_tests/indexes/test_indexing.py @@ -36,10 +36,6 @@ def lazy_load( ) -> Iterator[Document]: yield from self.documents - def load(self) -> List[Document]: - """Load the documents from the source.""" - return list(self.lazy_load()) - async def alazy_load( self, ) -> AsyncIterator[Document]: