Skip to content

Commit a4e555e

Browse files
committed
Remove max_count from storage.find
1 parent 3eb1e68 commit a4e555e

File tree

5 files changed

+0
-13
lines changed

5 files changed

+0
-13
lines changed

packages/graphrag/graphrag/storage/blob_pipeline_storage.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,11 @@ def _container_exists(self) -> bool:
9898
def find(
9999
self,
100100
file_pattern: re.Pattern[str],
101-
max_count=-1,
102101
) -> Iterator[str]:
103102
"""Find blobs in a container using a file pattern.
104103
105104
Params:
106105
file_pattern: The file pattern to use.
107-
max_count: The maximum number of blobs to return. If -1, all blobs are returned.
108106
109107
Returns
110108
-------
@@ -138,8 +136,6 @@ def _blobname(blob_name: str) -> str:
138136
if match:
139137
yield _blobname(blob.name)
140138
num_loaded += 1
141-
if max_count > 0 and num_loaded >= max_count:
142-
break
143139
else:
144140
num_filtered += 1
145141
logger.debug(

packages/graphrag/graphrag/storage/cosmosdb_pipeline_storage.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,11 @@ def _delete_container(self) -> None:
120120
def find(
121121
self,
122122
file_pattern: re.Pattern[str],
123-
max_count=-1,
124123
) -> Iterator[str]:
125124
"""Find documents in a Cosmos DB container using a file pattern regex.
126125
127126
Params:
128127
file_pattern: The file pattern to use.
129-
max_count: The maximum number of documents to return. If -1, all documents are returned.
130128
131129
Returns
132130
-------
@@ -164,8 +162,6 @@ def find(
164162
if match:
165163
yield item["id"]
166164
num_loaded += 1
167-
if max_count > 0 and num_loaded >= max_count:
168-
break
169165
else:
170166
num_filtered += 1
171167

packages/graphrag/graphrag/storage/file_pipeline_storage.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def __init__(self, **kwargs: Any) -> None:
4040
def find(
4141
self,
4242
file_pattern: re.Pattern[str],
43-
max_count=-1,
4443
) -> Iterator[str]:
4544
"""Find files in the storage using a file pattern."""
4645
logger.info(
@@ -59,8 +58,6 @@ def find(
5958
filename = filename[1:]
6059
yield filename
6160
num_loaded += 1
62-
if max_count > 0 and num_loaded >= max_count:
63-
break
6461
else:
6562
num_filtered += 1
6663
logger.debug(

packages/graphrag/graphrag/storage/pipeline_storage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class PipelineStorage(metaclass=ABCMeta):
1717
def find(
1818
self,
1919
file_pattern: re.Pattern[str],
20-
max_count=-1,
2120
) -> Iterator[str]:
2221
"""Find files in the storage using a file pattern."""
2322

tests/integration/storage/test_factory.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def __init__(self, **kwargs):
113113
def find(
114114
self,
115115
file_pattern: re.Pattern[str],
116-
max_count=-1,
117116
) -> Iterator[str]:
118117
return iter([])
119118

0 commit comments

Comments
 (0)