def visit_vars_csv(csv_node, callback, cbdata): if debug_prints(): # pragma: no cover print("visiting csv vars for:", csv_node) print("cbdata: ", sorted(cbdata.items())) # update output_vars new_out_vars = [] for col_var in csv_node.out_vars: new_var = visit_vars_inner(col_var, callback, cbdata) new_out_vars.append(new_var) csv_node.out_vars = new_out_vars csv_node.file_name = visit_vars_inner(csv_node.file_name, callback, cbdata) return
def visit_vars_filter(filter_node, callback, cbdata): if debug_prints(): # pragma: no cover print("visiting filter vars for:", filter_node) print("cbdata: ", sorted(cbdata.items())) filter_node.bool_arr = visit_vars_inner(filter_node.bool_arr, callback, cbdata) for col_name in list(filter_node.df_in_vars.keys()): filter_node.df_in_vars[col_name] = visit_vars_inner( filter_node.df_in_vars[col_name], callback, cbdata) for col_name in list(filter_node.df_out_vars.keys()): filter_node.df_out_vars[col_name] = visit_vars_inner( filter_node.df_out_vars[col_name], callback, cbdata)
def visit_vars_join(join_node, callback, cbdata): if debug_prints(): # pragma: no cover print("visiting join vars for:", join_node) print("cbdata: ", sorted(cbdata.items())) # left for col_name in list(join_node.left_vars.keys()): join_node.left_vars[col_name] = visit_vars_inner( join_node.left_vars[col_name], callback, cbdata) # right for col_name in list(join_node.right_vars.keys()): join_node.right_vars[col_name] = visit_vars_inner( join_node.right_vars[col_name], callback, cbdata) # output for col_name in list(join_node.df_out_vars.keys()): join_node.df_out_vars[col_name] = visit_vars_inner( join_node.df_out_vars[col_name], callback, cbdata)
def visit_vars_sort(sort_node, callback, cbdata): if debug_prints(): # pragma: no cover print("visiting sort vars for:", sort_node) print("cbdata: ", sorted(cbdata.items())) for i in range(len(sort_node.key_arrs)): sort_node.key_arrs[i] = visit_vars_inner(sort_node.key_arrs[i], callback, cbdata) sort_node.out_key_arrs[i] = visit_vars_inner(sort_node.out_key_arrs[i], callback, cbdata) for col_name in list(sort_node.df_in_vars.keys()): sort_node.df_in_vars[col_name] = visit_vars_inner( sort_node.df_in_vars[col_name], callback, cbdata) for col_name in list(sort_node.df_out_vars.keys()): sort_node.df_out_vars[col_name] = visit_vars_inner( sort_node.df_out_vars[col_name], callback, cbdata)
def dprint(*s): if debug_prints(): print(*s)