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

sqlalchemy version fix #114

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion backend/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"streaming_form_data",
"psutil",
"uvicorn",
"sqlalchemy>=1.4.0",
"colorama",
"sqlalchemy<=1.4.46",
# Postgres Driver
"psycopg2",
# Generates concise, unambiguous, URL-safe UUIDs.
Expand Down
2 changes: 0 additions & 2 deletions backend/src/contaxy/clients/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def list_files(
prefix: Optional[str] = None,
request_kwargs: Dict = {},
) -> List[File]:

query_params: Dict = {
"recursive": recursive,
"include_versions": include_versions,
Expand All @@ -47,7 +46,6 @@ def get_file_metadata(
version: Optional[str] = None,
request_kwargs: Dict = {},
) -> File:

query_params: Dict = {}
if version:
query_params.update({"version": version})
Expand Down
2 changes: 0 additions & 2 deletions backend/src/contaxy/managers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def _create_session_token(
scopes: List[str],
expiry_minutes: Optional[timedelta] = None,
) -> str:

if expiry_minutes:
expire = datetime.now(timezone.utc) + expiry_minutes
else:
Expand Down Expand Up @@ -339,7 +338,6 @@ def _verify_access_via_db(
) -> AuthorizedAccess:
scope_grants_access = False
for scope in token.scopes:

if not auth_utils.is_valid_permission(scope):
logger.warning(f"The token scope ({scope}) is not valid.")
continue
Expand Down
1 change: 0 additions & 1 deletion backend/src/contaxy/managers/deployment/kube_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def build_kube_service_config(
service_ports: Dict[str, V1ServicePort] = {}
if service.endpoints:
for endpoint in service.endpoints:

# An endpoint can be in the form of one of the examples ["8080", "9001/webapp/ui", "9002b"]. See the Contaxy endpoint docs <LINK> for more information.
port_number = endpoint.split("/")[0].replace("b", "")

Expand Down
2 changes: 0 additions & 2 deletions backend/src/contaxy/managers/deployment/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def deploy_service(
action_id: Optional[str] = None,
wait: bool = False,
) -> Service:

kube_service_config = build_kube_service_config(
service=service,
project_id=project_id,
Expand Down Expand Up @@ -249,7 +248,6 @@ def delete_service(
delete_volumes: bool = False,
retries: int = 0,
) -> None:

try:
self.core_api.delete_namespaced_service(
name=service_id,
Expand Down
2 changes: 0 additions & 2 deletions backend/src/contaxy/managers/file/azure_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ def _load_file_data_from_azure(
prefix: Optional[str] = None,
include_version: Optional[bool] = None,
) -> Tuple[List[File], List[str]]:

file_data: List[File] = []
db_keys: List[str] = []
file_versions: Dict[str, List[str]] = {}
Expand Down Expand Up @@ -559,7 +558,6 @@ def _load_file_data_from_azure(
def _enrich_data_from_db(
self, project_id: str, file_data: List[File], document_keys: List[str]
) -> Tuple[List[File], List[Tuple[str, str]]]:

json_docs = self.json_db_manager.list_json_documents(
project_id, self.DOC_COLLECTION_NAME, keys=document_keys
)
Expand Down
1 change: 0 additions & 1 deletion backend/src/contaxy/managers/file/minio.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ def _load_file_data_from_s3(
def _enrich_data_from_db(
self, project_id: str, file_data: List[File], document_keys: List[str]
) -> Tuple[List[File], List[Tuple[str, str]]]:

json_docs = self._json_db_manager.list_json_documents(
project_id, self.DOC_COLLECTION_NAME, keys=document_keys
)
Expand Down
1 change: 0 additions & 1 deletion backend/src/contaxy/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def hash(self) -> str:
return ""

def read(self, size: int = -1) -> bytes:

if size == 0:
return b""

Expand Down
1 change: 0 additions & 1 deletion backend/tests/test_file_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ def test_download_file(self) -> None:
assert version_1.md5_hash == hash.hexdigest()

def test_delete_file(self) -> None:

# Test - File does not exist
self.file_manager.delete_file(self.project_id, "invalid-key")

Expand Down
3 changes: 0 additions & 3 deletions backend/tests/test_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def metadata() -> dict:

@pytest.fixture()
def multipart_data(metadata: dict) -> dict:

stream = b'------WebKitFormBoundaryr1D8WqBUjhPTDqlM\r\nContent-Disposition: form-data; name="file"; filename="test.csv"\r\nContent-Type: text/csv\r\n\r\n'
stream += 5000 * b"foo;bar\n"
stream += b"\r\n------WebKitFormBoundaryr1D8WqBUjhPTDqlM--\r\n"
Expand All @@ -42,7 +41,6 @@ def file_data(metadata: dict) -> dict:
@pytest.mark.unit
class TestFormMultipartStream:
def test_multipart_stream(self, multipart_data: dict) -> None:

file_stream = multipart_data.get("stream")
assert file_stream

Expand All @@ -66,7 +64,6 @@ def test_multipart_stream(self, multipart_data: dict) -> None:
@pytest.mark.unit
class TestSyncFromAsyncGenerator:
def test_iteration(self) -> None:

data = list(range(5))

async def iterate(data: list) -> AsyncGenerator:
Expand Down
3 changes: 0 additions & 3 deletions backend/tests/test_json_db_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def test_delete_json_document(self) -> None:
)

def test_update_json_document(self) -> None:

original_dict = {
"title": "Goodbye!",
"author": {"givenName": "John", "familyName": "Doe"},
Expand Down Expand Up @@ -184,7 +183,6 @@ def test_update_json_document(self) -> None:
)

def test_list_json_documents(self) -> None:

collection_id = self.COLLECTTION

data = [
Expand Down Expand Up @@ -262,7 +260,6 @@ def test_list_json_documents(self) -> None:
)

def test_list_json_documents_by_key(self) -> None:

docs = []
db_keys = []
for i in range(3):
Expand Down