Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
2.0 kB
2
Indexable
Never
I have this code in A.py file
class __BasePerfWorkflowService:
    """Base class for Perf workflows"""

    def __init__(
        self,
        name: str,
        workflow_config: dict,
        user_config: dict,
        workflow_prefix: str = None,
        **kwargs,
    ):
        """
        Initialize base workflow
        Params:
        :workflow_params, dict, Workflow params.
        """
        self.__engine = None
        self.__workflow_type = None
        self.__rdsbms_manager = None
        self.__perf_manager = None
        self.__parent_workflow_id = None
        self.__internal_workflow_id = None
        self.__pas_workflow_type = None
        self.__workflow_config = None
        self.__workflow_params = None

        # Presets
        self.__name = name
        self.__workflow_prefix = workflow_prefix
        self.__user_config = copy.deepcopy(user_config)

        self._set_workflow_params(workflow_config)

        self.__db_instance_size = get_instance_size(self.workflow_config["config"])
        self.__workflow_user = kwargs.get("workflow_user", None)

 @property
    def workflow_config(self):
        """ """
        return self.__workflow_config

 @property
    def workflow_params(self):
        """ """
        return self.__workflow_params

ef sidekick_params_dict(self):
        """Returns sidekick params dict along with con information. None if sidekick is not passed through

        NOTE: sqlserver will default to PostgreSQL as it will be used for BBF.
        For sidekick service for sql server tests, this is not currently supported in PAS
        """

        if not self.is_sidekick_enabled:
            return None

        workflow_config = self.rdsbms_params_dict()



def rdsbms_params_dict(self):
        """Returns params dict."""
        return namespace_to_dict(self.workflow_params.config)

Now in B.py file I want to use the value obtained from this code from A.py
workflow_config = self.rdsbms_params_dict()

How to import and use in B.py
Leave a Comment