diff --git a/src/damavand/base/controllers/base_controller.py b/src/damavand/base/controllers/base_controller.py index 7c41445..ab847dd 100644 --- a/src/damavand/base/controllers/base_controller.py +++ b/src/damavand/base/controllers/base_controller.py @@ -1,5 +1,4 @@ import logging -from typing import Optional from functools import cache from pulumi import Resource as PulumiResource import pulumi @@ -40,14 +39,11 @@ class ApplicationController(object): def __init__( self, name: str, - id: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> None: self.name = name self.tags = tags - # FIXME: the id should be removed. - self._id = id self.extra_args = kwargs self._pulumi_object = None diff --git a/src/damavand/base/controllers/object_storage.py b/src/damavand/base/controllers/object_storage.py index 2ea5ac4..db995c6 100644 --- a/src/damavand/base/controllers/object_storage.py +++ b/src/damavand/base/controllers/object_storage.py @@ -1,4 +1,4 @@ -from typing import Iterable, Optional +from typing import Iterable from damavand.base.controllers import ApplicationController @@ -7,11 +7,10 @@ class ObjectStorageController(ApplicationController): def __init__( self, name, - id_: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> None: - super().__init__(name, id_, tags, **kwargs) + super().__init__(name, tags, **kwargs) def read(self, path: str) -> bytes: """Read an object from the storage.""" diff --git a/src/damavand/base/controllers/spark.py b/src/damavand/base/controllers/spark.py index 69e28ee..d43121e 100644 --- a/src/damavand/base/controllers/spark.py +++ b/src/damavand/base/controllers/spark.py @@ -1,6 +1,5 @@ import os import logging -from typing import Optional from pyspark.conf import SparkConf from pyspark.sql import SparkSession @@ -27,8 +26,6 @@ class SparkController(ApplicationController): the name of the controller. applications : list[Sparkle] the list of Spark applications. - id_ : Optional[str] - the ID of the controller. tags : dict[str, str] the tags of the controller. kwargs : dict @@ -51,11 +48,10 @@ class SparkController(ApplicationController): def __init__( self, name, - id_: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> None: - ApplicationController.__init__(self, name, id_, tags, **kwargs) + ApplicationController.__init__(self, name, tags, **kwargs) self.applications: list[Sparkle] @property diff --git a/src/damavand/base/factory.py b/src/damavand/base/factory.py index f6d7e3f..84156cb 100644 --- a/src/damavand/base/factory.py +++ b/src/damavand/base/factory.py @@ -44,7 +44,6 @@ def new( ctr = self._new_aws_controller( name=name, region=self.provider.explicit_region, - id=id, tags=self.tags, **kwargs, ) @@ -53,7 +52,6 @@ def new( case AzurermProvider(): ctr = self._new_azure_controller( name=name, - id=id, tags=self.tags, **kwargs, ) @@ -66,7 +64,6 @@ def _new_aws_controller( self, name: str, region: str, - id: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> ControllerType: @@ -75,7 +72,6 @@ def _new_aws_controller( def _new_azure_controller( self, name: str, - id: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> ControllerType: diff --git a/src/damavand/cloud/aws/controllers/object_storage.py b/src/damavand/cloud/aws/controllers/object_storage.py index 8dce966..f6ed9df 100644 --- a/src/damavand/cloud/aws/controllers/object_storage.py +++ b/src/damavand/cloud/aws/controllers/object_storage.py @@ -3,7 +3,7 @@ import io import logging from botocore.exceptions import ClientError -from typing import Iterable, Optional +from typing import Iterable from pulumi_aws import s3 from pulumi import Resource as PulumiResource @@ -24,11 +24,10 @@ def __init__( self, name, region: str, - id_: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> None: - super().__init__(name, id_, tags, **kwargs) + super().__init__(name, tags, **kwargs) self.__s3_client = boto3.client("s3", region_name=region) @buildtime diff --git a/src/damavand/cloud/aws/controllers/spark.py b/src/damavand/cloud/aws/controllers/spark.py index bb8bda0..b1239b6 100644 --- a/src/damavand/cloud/aws/controllers/spark.py +++ b/src/damavand/cloud/aws/controllers/spark.py @@ -1,5 +1,4 @@ import logging -from typing import Optional from functools import cache import boto3 @@ -19,11 +18,10 @@ def __init__( self, name, region: str, - id_: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> None: - super().__init__(name, id_, tags, **kwargs) + super().__init__(name, tags, **kwargs) self._glue_client = boto3.client("glue", region_name=region) @buildtime diff --git a/src/damavand/cloud/azure/controllers/spark.py b/src/damavand/cloud/azure/controllers/spark.py index 1913bf5..1905727 100644 --- a/src/damavand/cloud/azure/controllers/spark.py +++ b/src/damavand/cloud/azure/controllers/spark.py @@ -1,5 +1,4 @@ import logging -from typing import Optional from functools import cache import pulumi @@ -20,11 +19,10 @@ def __init__( self, name, region: str, - id_: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> None: - super().__init__(name, id_, tags, **kwargs) + super().__init__(name, tags, **kwargs) self.applications: list[Sparkle] @buildtime diff --git a/src/damavand/factories.py b/src/damavand/factories.py index b297a53..e8835f0 100644 --- a/src/damavand/factories.py +++ b/src/damavand/factories.py @@ -1,4 +1,3 @@ -from typing import Optional from damavand.base.controllers.spark import SparkController from damavand.base.factory import ApplicationControllerFactory @@ -11,24 +10,21 @@ def _new_aws_controller( self, name: str, region: str, - id: Optional[str] = None, tags: dict[str, str] = {}, **kwargs, ) -> SparkController: return AwsSparkController( name=name, region=region, - id=id, tags=tags, **kwargs, ) def _new_azure_controller( - self, name: str, id: Optional[str] = None, tags: dict[str, str] = {}, **kwargs + self, name: str, tags: dict[str, str] = {}, **kwargs ) -> SparkController: return AzureSparkController( name=name, - id=id, tags=tags, **kwargs, )