Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused imports #197

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions chromadb/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from abc import ABC, abstractmethod
from typing import Callable, Union, Sequence, Optional, TypedDict, List, Dict
from uuid import UUID
from typing import Callable, Union, Sequence, Optional, Dict
import pandas as pd
from chromadb.api.models.Collection import Collection
from chromadb.api.types import (
ID,
Documents,
Embeddings,
IDs,
Expand All @@ -15,7 +13,6 @@
GetResult,
WhereDocument,
)
import json

from chromadb.telemetry import Telemetry

Expand Down
1 change: 0 additions & 1 deletion chromadb/api/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Where,
WhereDocument,
)
from chromadb.errors import NoDatapointsException
import pandas as pd
import requests
import json
Expand Down
6 changes: 3 additions & 3 deletions chromadb/api/local.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import json
import uuid
import time
from typing import Dict, List, Optional, Sequence, Callable, Type, cast

from typing import Dict, List, Optional, Sequence, Callable, cast
from chromadb import __version__

from chromadb.api import API
from chromadb.db import DB
from chromadb.api.types import (
Documents,
Embedding,
Embeddings,
GetResult,
IDs,
Expand Down
2 changes: 1 addition & 1 deletion chromadb/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseSettings, Field
from pydantic import BaseSettings
from typing import List

TELEMETRY_WHITELISTED_SETTINGS = ["chroma_db_impl", "chroma_api_impl", "chroma_server_ssl_enabled"]
Expand Down
2 changes: 1 addition & 1 deletion chromadb/db/duckdb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from chromadb.api.types import Documents, Embeddings, IDs, Metadatas
from chromadb.db import DB
from chromadb.db.clickhouse import (
Clickhouse,
db_array_schema_to_clickhouse_schema,
Expand All @@ -20,6 +19,7 @@
logger = logging.getLogger(__name__)



def clickhouse_to_duckdb_schema(table_schema):
for item in table_schema:
if "embedding" in item:
Expand Down
2 changes: 0 additions & 2 deletions chromadb/db/index/hnswlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import pickle
import time
from typing import Optional
import uuid
from chromadb.api.types import IndexMetadata
import hnswlib
import numpy as np
from chromadb.db.index import Index
from chromadb.errors import NoIndexException, InvalidDimensionException, NotEnoughElementsException
import logging
Expand Down
2 changes: 2 additions & 0 deletions chromadb/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@


class Server(ABC):

@abstractmethod
def __init__(self, settings):
pass
9 changes: 3 additions & 6 deletions chromadb/server/fastapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fastapi
from fastapi import FastAPI
from fastapi import FastAPI as _FastAPI
from fastapi.responses import JSONResponse

from fastapi.middleware.cors import CORSMiddleware
Expand All @@ -15,26 +15,23 @@
)
from chromadb.server.fastapi.types import (
AddEmbedding,
CountEmbedding,
DeleteEmbedding,
GetEmbedding,
ProcessEmbedding,
QueryEmbedding,
RawSql, # Results,
SpaceKeyInput,
CreateCollection,
UpdateCollection,
UpdateEmbedding,
)
from starlette.requests import Request
from starlette.responses import Response

import logging
from chromadb.telemetry import ServerContext, Telemetry

logger = logging.getLogger(__name__)


def use_route_names_as_operation_ids(app: FastAPI) -> None:
def use_route_names_as_operation_ids(app: _FastAPI) -> None:
"""
Simplify operation IDs so that generated API clients have simpler function
names.
Expand Down
2 changes: 1 addition & 1 deletion chromadb/server/fastapi/types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import BaseModel
from typing import List, Union, Any
from typing import List, Union
from chromadb.api.types import Include

# type supports single and batch mode
Expand Down
3 changes: 0 additions & 3 deletions chromadb/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
from chromadb.api import API
from chromadb.api.types import QueryResult
from chromadb.config import Settings
from chromadb.errors import NoDatapointsException
import chromadb.server.fastapi
import pytest
import time
import tempfile
import copy
import os
from multiprocessing import Process
import uvicorn
from requests.exceptions import ConnectionError
from chromadb.api.models import Collection


@pytest.fixture
Expand Down
1 change: 0 additions & 1 deletion chromadb/test/test_chroma.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
import unittest
import os
from unittest.mock import patch
Expand Down