def invalidDataSet()

in lib/telemetry.py [0:0]


def invalidDataSet(df, histogram, branches, segments):
  if df.empty:
    print(f"Empty dataset found, removing: {histogram}.")
    return True

  for branch in branches:
    branch_name = branch['name']
    branch_df = df[df["branch"]==branch_name]
    if branch_df.empty:
      print(f"Empty dataset found for branch={branch_name}, removing: {histogram}.")
      return True
    for segment in segments:
      if segment=="All":
        continue
      branch_segment_df = branch_df[branch_df["segment"]==segment]
      if branch_segment_df.empty:
        print(f"Empty dataset found for segment={segment}, removing: {histogram}.")
        return True

  return False