delete Method

On This Page

Description

Deletes a NoSQL table.

Syntax

delete(backend, table)

Note

The method has additional parameters that aren’t currently supported for the NoSQL backend. Therefore, when calling the method, be sure to explicitly specify the names of all parameters after table.

Parameters

backend | if_missing | table

backend
The backend type — "kv" for the NoSQL backend. See Backend Types.

  • Type: str
  • Requirement: Required
table
The relative path to the backend data — a directory in the target data container (as configured for the client object) that represents a NoSQL table. For example, "mytable" or "examples/nosql/my_table".

  • Type: str
  • Requirement: Required
if_missing

Determines whether to raise an error when the specified NoSQL table (table) doesn’t exist.

  • Type: pb.ErrorOptions enumeration. To use the enumeration, import the frames_pb2 module; for example:

      from v3io_frames import frames_pb2 as fpb
  • Requirement: Optional
  • Valid Values: FAIL to raise an error when the specified table doesn’t exist; IGNORE to ignore this
  • Default Value: FAIL

Errors

In case of an error, the method raises a DeleteError error.

Examples

Following are some usage examples for the delete method of the Frames NoSQL backend:

  1. Delete a mytable table in the client’s data container (table):

    table = "mytable"
    client.delete(backend="kv", table=table)
  2. Delete a my_tables/students_11-15 table in the client’s data container (table); don’t raise an error if the table doesn’t exist (if_missing = IGNORE):

    from v3io_frames import frames_pb2 as fpb
    table = "/my_tables/students_11-15"
    client.delete("kv", table=table, if_missing=fpb.IGNORE)

See Also