src/dirbs/api/v2/resources/imei.py
def first_seen(cursor, imei_norm: str) -> str:
    """
    Method to extract min first_seen of an IMEI.

    Arguments:
        cursor: PostgreSQL database connection cursor object
        imei_norm: Normalized IMEI
    Returns:
        first_seen date of IMEI if exists otherwise None
    """
    cursor.execute("""SELECT MIN(first_seen) AS first_seen
                        FROM network_imeis
                       WHERE imei_norm = %(imei_norm)s
                         AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)""",
                   {'imei_norm': imei_norm})
    return cursor.fetchone().first_seen

    Method to extract min first_seen of an IMEI.

    Arguments:
        cursor: PostgreSQL database connection cursor object
        imei_norm: Normalized IMEI
    Returns:
        first_seen date of IMEI if exists otherwise None
    
Method to extract min first_seen of an IMEI.
Method to extract min first_seen of an IMEI .
def first_seen(cursor, imei_norm: str) -> str:
    cursor.execute("""SELECT MIN(first_seen) AS first_seen
                        FROM network_imeis
                       WHERE imei_norm = %(imei_norm)s
                         AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)""",
                   {'imei_norm': imei_norm})
    return cursor.fetchone().first_seen
def first_seen ( cursor , imei_norm : str ) -> str : cursor . execute ( """SELECT MIN(first_seen) AS first_seen
                        FROM network_imeis
                       WHERE imei_norm = %(imei_norm)s
                         AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)""" , { 'imei_norm' : imei_norm } ) return cursor . fetchone ( ) . first_seen
Method to extract min first_seen of an IMEI.
Method to extract min first_seen of an IMEI .
"""
    Method to extract min first_seen of an IMEI.

    Arguments:
        cursor: PostgreSQL database connection cursor object
        imei_norm: Normalized IMEI
    Returns:
        first_seen date of IMEI if exists otherwise None
    """
first_seen date of IMEI if exists otherwise None
first_seen date of IMEI if exists otherwise None
cursor
PostgreSQL database connection cursor object
PostgreSQL database connection cursor object
imei_norm
str
None