예제 #1
0
 def __init__(self, service: str, **kwargs):
     self.service_account = service_account.Credentials.from_service_account_file(
         os.environ['MYSQL_BIG_QUERY_GOOGLE_AUTH']
     )
     self.definitions = service_helpers.get_definitions(service)
     self.sd_logger = StackDriverAdapter(self.service_account)
     self.sd_logger.get_client()
     self.sd_logger.create_logger(f"service-add-big-query")
     super().__init__(**kwargs)
예제 #2
0
    def __init__(self, service: str, **kwargs):
        self.service_account = service_account.Credentials.from_service_account_file(
            os.environ['MYSQL_BIG_QUERY_GOOGLE_AUTH'])
        self.definitions = service_helpers.get_definitions(service)

        self.sd_logger = StackDriverAdapter(self.service_account)
        self.sd_logger.get_client()
        self.sd_logger.create_logger(f"{self.definitions['service']}-etl")

        self.pub_sub_client = PubSubAdapter(self.service_account)
        self.pub_sub_client.get_subscriber()
        self.pub_sub_client.set_subscription(
            f"{self.definitions['service']}-etl-schema")

        self.big_query_client = BigQueryAdapter(self.service_account)
        self.big_query_client.get_client()
        self.big_query_client.set_data_set_ref(self.definitions['data_set'])
        super().__init__(**kwargs)
예제 #3
0
    def __init__(self, service: str, **kwargs):
        self.table = None
        self.watched_column = None
        self.primary_id = None
        self.sample_size = 1000
        self.service_account = service_account.Credentials.from_service_account_file(
            os.environ['MYSQL_BIG_QUERY_GOOGLE_AUTH'])
        self.definitions = service_helpers.get_definitions(service)

        self.sd_logger = StackDriverAdapter(self.service_account)
        self.sd_logger.get_client()
        self.sd_logger.create_logger(f"{self.definitions['service']}-etl")

        self.pub_sub_client = PubSubAdapter(self.service_account)
        self.pub_sub_client.get_subscriber()
        self.pub_sub_client.set_subscription(
            f"{self.definitions['service']}-etl")

        self.big_query_client = BigQueryAdapter(self.service_account)
        self.big_query_client.get_client()
        self.big_query_client.set_data_set_ref(self.definitions['data_set'])

        self.my_sql_client = MySqlAdapter()
        super().__init__(**kwargs)
예제 #4
0
 def get_definitions(self):
     self.definitions = service_helpers.get_definitions(self.service)
예제 #5
0
 def get_definitions(self, service_name: str):
     self.definitions = service_helpers.get_definitions(service_name)
예제 #6
0
 def __init__(self, service: str):
     self.definitions = service_helpers.get_definitions(service)
     del (self.definitions['service'])
     del (self.definitions['data_set'])
     self.connection = None
     self.errors = {}