def clean(self):
    cleaned_data = super(SaveResultsTableForm, self).clean()
    target_table = cleaned_data.get('target_table')

    if not target_table:
      raise forms.ValidationError(_("Table name is required."))
    else:
      if self.db != None:
        raise forms.ValidationError(_("Cannot validate form, db object is required."))
      else:
        # Table field may be set to <database>.<table> so we need to parse it before validation
        name_parts = target_table.split(".")
        if len(name_parts) == 1:
          pass
        elif len(name_parts) == 2:   # Update table name without the DB prefix
          self.target_database, target_table = name_parts
        else:
          raise forms.ValidationError(_("Invalid table prefix name."))

        # Check if table already exists
        table = None
        try:
          table = self.db.get_table(self.target_database, target_table)
        except Exception:
          cleaned_data['target_table'] = target_table

        if table is not None:
          raise forms.ValidationError(_("Table %s.%s already exists") % (self.target_database, target_table))

    return cleaned_data
dataset/ETHPy150Open cloudera/hue/apps/beeswax/src/beeswax/forms.py/SaveResultsTableForm.clean/operator `is` -> `!=`