def get_materialized_checkpoints(checkpoints, colnames, lower_dt, odo_kwargs):
 if (checkpoints is not None):
  ts = checkpoints[TS_FIELD_NAME]
  checkpoints_ts = odo(ts[(ts <= lower_dt)].max(), pd.Timestamp, **odo_kwargs)
  if pd.isnull(checkpoints_ts):
   materialized_checkpoints = pd.DataFrame(columns=colnames)
   lower = None
  else:
   materialized_checkpoints = odo(checkpoints[(ts == checkpoints_ts)][colnames], pd.DataFrame, **odo_kwargs)
   lower = checkpoints_ts
 else:
  materialized_checkpoints = pd.DataFrame(columns=colnames)
  lower = None
 return (lower, materialized_checkpoints)

def get_materialized_checkpoints ( checkpoints , colnames , lower_dt , odo_kwargs ) : if ( checkpoints is not None ) : ts = checkpoints [ TS_FIELD_NAME ] checkpoints_ts = odo ( ts [ ( ts <= lower_dt ) ] . max ( ) , pd . Timestamp , ** odo_kwargs ) if pd . isnull ( checkpoints_ts ) : materialized_checkpoints = pd . DataFrame ( columns = colnames ) lower = None else : materialized_checkpoints = odo ( checkpoints [ ( ts == checkpoints_ts ) ] [ colnames ] , pd . DataFrame , ** odo_kwargs ) lower = checkpoints_ts else : materialized_checkpoints = pd . DataFrame ( columns = colnames ) lower = None return ( lower , materialized_checkpoints )
computes a lower bound and a dataframe checkpoints .