python/pyspark/rdd.py
def _extract_concise_traceback():
    """
    This function returns the traceback info for a callsite, returns a dict
    with function name, file name and line number
    """
    tb = traceback.extract_stack()
    callsite = namedtuple("Callsite", "function file linenum")
    if len(tb) == 0:
        return None
    file, line, module, what = tb[len(tb) - 1]
    sparkpath = os.path.dirname(file)
    first_spark_frame = len(tb) - 1
    for i in range(0, len(tb)):
        file, line, fun, what = tb[i]
        if file.startswith(sparkpath):
            first_spark_frame = i
            break
    if first_spark_frame == 0:
        file, line, fun, what = tb[0]
        return callsite(function=fun, file=file, linenum=line)
    sfile, sline, sfun, swhat = tb[first_spark_frame]
    ufile, uline, ufun, uwhat = tb[first_spark_frame-1]
    return callsite(function=sfun, file=ufile, linenum=uline)

    This function returns the traceback info for a callsite, returns a dict
    with function name, file name and line number
    
This function returns the traceback info for a callsite, returns a dict
with function name, file name and line number
This function returns the traceback info for a callsite returns a dict with function name file name and line number
def _extract_concise_traceback():
    tb = traceback.extract_stack()
    callsite = namedtuple("Callsite", "function file linenum")
    if len(tb) == 0:
        return None
    file, line, module, what = tb[len(tb) - 1]
    sparkpath = os.path.dirname(file)
    first_spark_frame = len(tb) - 1
    for i in range(0, len(tb)):
        file, line, fun, what = tb[i]
        if file.startswith(sparkpath):
            first_spark_frame = i
            break
    if first_spark_frame == 0:
        file, line, fun, what = tb[0]
        return callsite(function=fun, file=file, linenum=line)
    sfile, sline, sfun, swhat = tb[first_spark_frame]
    ufile, uline, ufun, uwhat = tb[first_spark_frame-1]
    return callsite(function=sfun, file=ufile, linenum=uline)
def _extract_concise_traceback ( ) : tb = traceback . extract_stack ( ) callsite = namedtuple ( "Callsite" , "function file linenum" ) if len ( tb ) == 0 : return None file , line , module , what = tb [ len ( tb ) - 1 ] sparkpath = os . path . dirname ( file ) first_spark_frame = len ( tb ) - 1 for i in range ( 0 , len ( tb ) ) : file , line , fun , what = tb [ i ] if file . startswith ( sparkpath ) : first_spark_frame = i break if first_spark_frame == 0 : file , line , fun , what = tb [ 0 ] return callsite ( function = fun , file = file , linenum = line ) sfile , sline , sfun , swhat = tb [ first_spark_frame ] ufile , uline , ufun , uwhat = tb [ first_spark_frame - 1 ] return callsite ( function = sfun , file = ufile , linenum = uline )
This function returns the traceback info for a callsite, returns a dict
with function name, file name and line number
This function returns the traceback info for a callsite returns a dict with function name file name and line number
"""
    This function returns the traceback info for a callsite, returns a dict
    with function name, file name and line number
    """