see on GitHub

Session: Deleting entities

Entities can be marked for deletion by using delete method, but will not be removed from server until save_changes is called.

Syntax

def delete(self, key_or_entity):

def delete_by_entity(self, entity):

Parameters
entity or key_or_entity entity, str or entity instance of entity to delete or entity Id

The delete method can be used with entity or str. by calling delete with entity delete_by_entity will be executed

Example 1

employee = session.load("employees/1")
session.delete(employee)
session.save_changes()

Example 2

session.delete("employees/1")

Example 3

employee = session.load("employees/1")
session.delete_by_entity(employee)