This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
import pymongo | |
def check_indexes( | |
collection: pymongo.colllection.Collection, indexes: List[pymongo.IndexModel] | |
) -> None: | |
""" | |
Check if the indexes given in the `indexes` argument already | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
import zlib | |
from pymongo import MongoClient | |
import numpy as np | |
db = MongoClient("host:port")["database"] | |
# get all items that are no older than 30 days | |
query_filter = {"created_t": {"$gte": datetime.now() - timedelta(days=30)}} | |
# Get the data fields where the compressed numpy arrays are stored | |
projection = {"text_embedding": True, "image_embedding": True} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "colarec", | |
"image": "211367837384.dkr.ecr.ap-northeast-1.amazonaws.com/colarec_production:colarec-latest", | |
"environment": [ | |
{ | |
"name": "RUNTIME_ENVIRONMENT", | |
"value": "production" | |
} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logging.warning('Watch out!') # will print a message to the console | |
logging.info('I told you so') # will not print anything | |
logging.info('New print') # will not print anything |