def init(self, conf: ConfigTree) -> None:
        BaseBigQueryExtractor.init(self, conf)
        self.timestamp = conf.get_string(
            BigQueryTableUsageExtractor.TIMESTAMP_KEY,
            (date.today() - timedelta(days=1)).strftime('%Y-%m-%dT00:00:00Z'))

        self.email_pattern = conf.get_string(BigQueryTableUsageExtractor.EMAIL_PATTERN, None)
        self.delay_time = conf.get_int(BigQueryTableUsageExtractor.DELAY_TIME, 100)

        self.table_usage_counts: Dict[TableColumnUsageTuple, int] = {}
        self._count_usage()
        self.iter = iter(self.table_usage_counts)
    def init(self, conf):
        # type: (ConfigTree) -> None
        BaseBigQueryExtractor.init(self, conf)
        self.timestamp = conf.get_string(
            BigQueryTableUsageExtractor.TIMESTAMP_KEY,
            (date.today() - timedelta(days=1)).strftime('%Y-%m-%dT00:00:00Z'))

        self.email_pattern = conf.get_string(
            BigQueryTableUsageExtractor.EMAIL_PATTERN, None)

        self.table_usage_counts = {}
        self._count_usage()
        self.iter = iter(self.table_usage_counts)
예제 #3
0
    def init(self, conf: ConfigTree) -> None:
        BaseBigQueryExtractor.init(self, conf)
        self.timestamp = conf.get_string(
            BigQueryTableUsageExtractor.TIMESTAMP_KEY,
            (datetime.now(timezone.utc) - timedelta(days=1)).strftime(
                BigQueryTableUsageExtractor.DATE_TIME_FORMAT))

        self.email_pattern = conf.get_string(
            BigQueryTableUsageExtractor.EMAIL_PATTERN, None)
        self.delay_time = conf.get_int(BigQueryTableUsageExtractor.DELAY_TIME,
                                       100)
        self.table_usage_counts: Dict[TableColumnUsageTuple, int] = {}
        # GCP console allows running queries using tables from a project different from the one the extractor is
        # used for; only usage metadata of referenced tables present in the given project_id_key for the
        # extractor is taken into account and usage metadata of referenced tables from other projects
        # is ignored by "default".
        self.count_reads_only_from_same_project = conf.get_bool(
            BigQueryTableUsageExtractor.COUNT_READS_ONLY_FROM_PROJECT_ID_KEY,
            True)
        self._count_usage()
        self.iter = iter(self.table_usage_counts)
예제 #4
0
 def init(self, conf: ConfigTree) -> None:
     BaseBigQueryExtractor.init(self, conf)
     self.iter: Iterator[Watermark] = iter(self._iterate_over_tables())
예제 #5
0
 def init(self, conf: ConfigTree) -> None:
     BaseBigQueryExtractor.init(self, conf)
     self.grouped_tables: Set[str] = set([])
     self.iter = iter(self._iterate_over_tables())
예제 #6
0
 def init(self, conf):
     # type: (ConfigTree) -> None
     BaseBigQueryExtractor.init(self, conf)
     self.grouped_tables = set([])
예제 #7
0
 def init(self, conf):
     # type: (ConfigTree) -> None
     BaseBigQueryExtractor.init(self, conf)
     self.iter = iter(self._iterate_over_tables())