From 6920404517c7fa4fb712d04ffca06a5f7555d04c Mon Sep 17 00:00:00 2001 From: niklastheman Date: Wed, 8 Jan 2025 18:03:37 +0100 Subject: [PATCH] linting fix --- fedn/cli/run_cmd.py | 2 -- fedn/network/api/v1/package_routes.py | 1 - fedn/network/combiner/interfaces.py | 2 -- fedn/network/controller/controlbase.py | 2 -- fedn/network/storage/statestore/stores/model_store.py | 7 +++---- fedn/network/storage/statestore/stores/prediction_store.py | 4 ++-- fedn/network/storage/statestore/stores/round_store.py | 7 +++---- fedn/network/storage/statestore/stores/session_store.py | 7 ++----- fedn/network/storage/statestore/stores/status_store.py | 4 ++-- fedn/network/storage/statestore/stores/validation_store.py | 4 ++-- 10 files changed, 14 insertions(+), 26 deletions(-) diff --git a/fedn/cli/run_cmd.py b/fedn/cli/run_cmd.py index 93a4a80b8..7be9458bd 100644 --- a/fedn/cli/run_cmd.py +++ b/fedn/cli/run_cmd.py @@ -5,10 +5,8 @@ import click import yaml -from fedn.cli.client_cmd import validate_client_config from fedn.cli.main import main from fedn.cli.shared import apply_config -from fedn.common.exceptions import InvalidClientConfig from fedn.common.log_config import logger from fedn.utils.dispatcher import Dispatcher, _read_yaml_file diff --git a/fedn/network/api/v1/package_routes.py b/fedn/network/api/v1/package_routes.py index bdc2dd7f4..f6d83fa91 100644 --- a/fedn/network/api/v1/package_routes.py +++ b/fedn/network/api/v1/package_routes.py @@ -11,7 +11,6 @@ from fedn.network.api.shared import package_store, repository from fedn.network.api.v1.shared import api_version, get_post_data_to_kwargs, get_typed_list_headers from fedn.network.storage.statestore.stores.shared import EntityNotFound -from fedn.utils.checksum import sha bp = Blueprint("package", __name__, url_prefix=f"/api/{api_version}/packages") diff --git a/fedn/network/combiner/interfaces.py b/fedn/network/combiner/interfaces.py index 63aac839b..2dc485754 100644 --- a/fedn/network/combiner/interfaces.py +++ b/fedn/network/combiner/interfaces.py @@ -1,8 +1,6 @@ import base64 import copy import json -import time -from io import BytesIO import grpc diff --git a/fedn/network/controller/controlbase.py b/fedn/network/controller/controlbase.py index 92c4fcb3e..bdf4f9284 100644 --- a/fedn/network/controller/controlbase.py +++ b/fedn/network/controller/controlbase.py @@ -1,10 +1,8 @@ import os from abc import ABC, abstractmethod from datetime import datetime -from time import sleep from typing import Any, Tuple -import pymongo import fedn.utils.helpers.helpers from fedn.common.log_config import logger diff --git a/fedn/network/storage/statestore/stores/model_store.py b/fedn/network/storage/statestore/stores/model_store.py index f7e04182d..8ee2bb1a5 100644 --- a/fedn/network/storage/statestore/stores/model_store.py +++ b/fedn/network/storage/statestore/stores/model_store.py @@ -1,14 +1,13 @@ from abc import abstractmethod from datetime import datetime -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, Dict, List, Tuple import pymongo from bson import ObjectId from pymongo.database import Database -from sqlalchemy import ForeignKey, String, func, select, union_all -from sqlalchemy.orm import Mapped, aliased, mapped_column, relationship +from sqlalchemy import func, select +from sqlalchemy.orm import aliased from sqlalchemy.sql import text -from werkzeug.utils import secure_filename from fedn.network.storage.statestore.stores.shared import EntityNotFound, from_document from fedn.network.storage.statestore.stores.sql_models import ModelModel diff --git a/fedn/network/storage/statestore/stores/prediction_store.py b/fedn/network/storage/statestore/stores/prediction_store.py index fcad17e1d..116d69ee3 100644 --- a/fedn/network/storage/statestore/stores/prediction_store.py +++ b/fedn/network/storage/statestore/stores/prediction_store.py @@ -2,8 +2,8 @@ import pymongo from pymongo.database import Database -from sqlalchemy import ForeignKey, Integer, String, and_, func, or_, select -from sqlalchemy.orm import Mapped, mapped_column, relationship +from sqlalchemy import ForeignKey, String, func, select +from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.sql import text from fedn.network.storage.statestore.stores.shared import EntityNotFound diff --git a/fedn/network/storage/statestore/stores/round_store.py b/fedn/network/storage/statestore/stores/round_store.py index a697ff603..12ff465ea 100644 --- a/fedn/network/storage/statestore/stores/round_store.py +++ b/fedn/network/storage/statestore/stores/round_store.py @@ -1,15 +1,14 @@ from abc import abstractmethod -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, Dict, List, Tuple import pymongo from bson import ObjectId from pymongo.database import Database -from sqlalchemy import ForeignKey, Integer, String, and_, func, or_, select -from sqlalchemy.orm import Mapped, mapped_column, relationship +from sqlalchemy import Integer, func, or_, select from sqlalchemy.sql import text from fedn.network.storage.statestore.stores.sql_models import RoundCombinerModel, RoundConfigModel, RoundDataModel, RoundModel -from fedn.network.storage.statestore.stores.store import MongoDBStore, MyAbstractBase, Session, SQLStore, Store +from fedn.network.storage.statestore.stores.store import MongoDBStore, Session, SQLStore, Store from .shared import EntityNotFound, from_document diff --git a/fedn/network/storage/statestore/stores/session_store.py b/fedn/network/storage/statestore/stores/session_store.py index 494ca060f..16ece2bc8 100644 --- a/fedn/network/storage/statestore/stores/session_store.py +++ b/fedn/network/storage/statestore/stores/session_store.py @@ -1,15 +1,12 @@ import datetime -import json import uuid -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, Dict, List, Tuple import pymongo from bson import ObjectId from pymongo.database import Database -from sqlalchemy import ForeignKey, String, func, select -from sqlalchemy.orm import Mapped, mapped_column, relationship +from sqlalchemy import func, select from sqlalchemy.sql import text -from werkzeug.utils import secure_filename from fedn.network.storage.statestore.stores.shared import EntityNotFound, from_document from fedn.network.storage.statestore.stores.sql_models import SessionConfigModel, SessionModel diff --git a/fedn/network/storage/statestore/stores/status_store.py b/fedn/network/storage/statestore/stores/status_store.py index 9b8a53c7e..81a8d8422 100644 --- a/fedn/network/storage/statestore/stores/status_store.py +++ b/fedn/network/storage/statestore/stores/status_store.py @@ -2,8 +2,8 @@ import pymongo from pymongo.database import Database -from sqlalchemy import ForeignKey, Integer, String, and_, func, or_, select -from sqlalchemy.orm import Mapped, mapped_column, relationship +from sqlalchemy import ForeignKey, String, func, select +from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.sql import text from fedn.network.storage.statestore.stores.shared import EntityNotFound diff --git a/fedn/network/storage/statestore/stores/validation_store.py b/fedn/network/storage/statestore/stores/validation_store.py index 79d277541..5804ecf84 100644 --- a/fedn/network/storage/statestore/stores/validation_store.py +++ b/fedn/network/storage/statestore/stores/validation_store.py @@ -2,8 +2,8 @@ import pymongo from pymongo.database import Database -from sqlalchemy import ForeignKey, Integer, String, and_, func, or_, select -from sqlalchemy.orm import Mapped, mapped_column, relationship +from sqlalchemy import ForeignKey, String, func, select +from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.sql import text from fedn.network.storage.statestore.stores.shared import EntityNotFound