import re


def bqtk_default_context(request) -> str:
    """Generate unique id by using pytest nodeid.

    Args:
        request: pytest fixture which provide tests context info.

    Returns:
        str: unique id matching big query name constraints
    """
    invalid_bq_chars = re.compile('([^a-zA-Z0-9_]+)')
    nodeid = request.node.nodeid
    return invalid_bq_chars.sub('_', nodeid)