def _delete_null_columns(self):
ds = DeleteStatement(self.column_family_name)<EOL>deleted_fields = False<EOL>for _, v in self.instance._values.items():<EOL><INDENT>col = v.column<EOL>if v.deleted:<EOL><INDENT>ds.add_field(col.db_field_name)<EOL>deleted_fields = True<EOL><DEDENT>elif isinstance(col, Map):<EOL><INDENT>uc = MapDeleteClause(col.db_field_name, v.value, v.previous_value)<EOL>if uc.get_context_size() > <NUM_LIT:0>:<EOL><INDENT>ds.add_field(uc)<EOL>deleted_fields = True<EOL><DEDENT><DEDENT><DEDENT>if deleted_fields:<EOL><INDENT>for name, col in self.model._primary_keys.items():<EOL><INDENT>ds.add_where_clause(WhereClause(<EOL>col.db_field_name,<EOL>EqualsOperator(),<EOL>col.to_database(getattr(self.instance, name))<EOL>))<EOL><DEDENT>self._execute(ds)<EOL><DEDENT>
executes a delete query to remove columns that have changed to null