chore: linting (#414)
This commit is contained in:
@@ -52,8 +52,7 @@ class CustomAppConfig(BaseAppConfig):
|
|||||||
super().__init__(
|
super().__init__(
|
||||||
log_level=log_level,
|
log_level=log_level,
|
||||||
embedding_fn=CustomAppConfig.embedding_function(
|
embedding_fn=CustomAppConfig.embedding_function(
|
||||||
embedding_function=embedding_fn, model=embedding_fn_model,
|
embedding_function=embedding_fn, model=embedding_fn_model, deployment_name=deployment_name
|
||||||
deployment_name=deployment_name
|
|
||||||
),
|
),
|
||||||
db=db,
|
db=db,
|
||||||
host=host,
|
host=host,
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class DataFormatter:
|
|||||||
elif data_type in lazy_loaders:
|
elif data_type in lazy_loaders:
|
||||||
if data_type == "notion":
|
if data_type == "notion":
|
||||||
from embedchain.loaders.notion import NotionLoader
|
from embedchain.loaders.notion import NotionLoader
|
||||||
|
|
||||||
return NotionLoader()
|
return NotionLoader()
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unsupported data type: {data_type}")
|
raise ValueError(f"Unsupported data type: {data_type}")
|
||||||
|
|||||||
@@ -86,6 +86,6 @@ def use_pysqlite3():
|
|||||||
print(
|
print(
|
||||||
f"{current_time} [embedchain] [ERROR]",
|
f"{current_time} [embedchain] [ERROR]",
|
||||||
"Failed to swap std-lib sqlite3 with pysqlite3 for ChromaDb compatibility.",
|
"Failed to swap std-lib sqlite3 with pysqlite3 for ChromaDb compatibility.",
|
||||||
f"Error:",
|
"Error:",
|
||||||
e
|
e,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ class TestChromaDbHostsLoglevel(unittest.TestCase):
|
|||||||
self.assertEqual(mock_client.call_args[0][0].chroma_server_host, None)
|
self.assertEqual(mock_client.call_args[0][0].chroma_server_host, None)
|
||||||
self.assertEqual(mock_client.call_args[0][0].chroma_server_http_port, None)
|
self.assertEqual(mock_client.call_args[0][0].chroma_server_http_port, None)
|
||||||
|
|
||||||
|
|
||||||
class TestChromaDbDuplicateHandling:
|
class TestChromaDbDuplicateHandling:
|
||||||
def test_duplicates_throw_warning(self, caplog):
|
def test_duplicates_throw_warning(self, caplog):
|
||||||
"""
|
"""
|
||||||
@@ -197,9 +198,9 @@ class TestChromaDbCollection(unittest.TestCase):
|
|||||||
app2.collection.add(embeddings=[0, 0, 0], ids=["0"])
|
app2.collection.add(embeddings=[0, 0, 0], ids=["0"])
|
||||||
|
|
||||||
# Swap names and test
|
# Swap names and test
|
||||||
app1.set_collection('test_collection_2')
|
app1.set_collection("test_collection_2")
|
||||||
self.assertEqual(app1.count(), 1)
|
self.assertEqual(app1.count(), 1)
|
||||||
app2.set_collection('test_collection_1')
|
app2.set_collection("test_collection_1")
|
||||||
self.assertEqual(app2.count(), 3)
|
self.assertEqual(app2.count(), 3)
|
||||||
|
|
||||||
def test_ids_share_collections(self):
|
def test_ids_share_collections(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user