(
        self, key_prefix: str, metric_query: str, time_start: int, time_end: int, table: "boto3.dynamodb.Table",
    )
return metric_keys
Query the global secondary index for any keys matching the metric query
Query the global secondary index for any keys matching the metric query
Query the global secondary index for any keys matching the metric query
def _get_keys_from_query(
        self, key_prefix: str, metric_query: str, time_start: int, time_end: int, table: "boto3.dynamodb.Table",
    ) -> Set[str]:
        """ Query the global secondary index for any keys matching the metric query """
        metric_keys: Set[str] = set()

        for i in range(_GSI_PARTITIONS):
            query_condition = Key(GSI_PK).eq(i) & Key(GSI_SORT).between(
                key_prefix + str(time_start), key_prefix + str(time_end),
            )
            response = table.query(IndexName=GSI_NAME, KeyConditionExpression=query_condition,)
            metric_keys |= {item["key"] for item in response["Items"] if re.search(metric_query, item["key"])}

        return metric_keys
def _get_keys_from_query ( self , key_prefix : str , metric_query : str , time_start : int , time_end : int , table : "boto3.dynamodb.Table" , ) -> Set [ str ] : metric_keys : Set [ str ] = set ( ) for i in range ( _GSI_PARTITIONS ) : query_condition = Key ( GSI_PK ) . eq ( i ) & Key ( GSI_SORT ) . between ( key_prefix + str ( time_start ) , key_prefix + str ( time_end ) , ) response = table . query ( IndexName = GSI_NAME , KeyConditionExpression = query_condition , ) metric_keys |= { item [ "key" ] for item in response [ "Items" ] if re . search ( metric_query , item [ "key" ] ) } return metric_keys