graviti.operation.sheet#

Definitions of different operations about the sheet on a draft.

Module Contents#

Classes#

SheetOperation

This class defines the basic method of the operation about the sheet on a draft.

CreateSheet

This class defines the operation that create a sheet.

DeleteSheet

This class defines the operation that delete a sheet.

class graviti.operation.sheet.SheetOperation(sheet)[source]#

This class defines the basic method of the operation about the sheet on a draft.

Parameters

sheet (str) – The sheet name.

abstract execute(self, dataset, draft_number)[source]#

Execute the OpenAPI create sheet.

Parameters
  • dataset (graviti.manager.Dataset) – The Dataset instance.

  • draft_number (int) – The draft number.

Raises

NotImplementedError – The method of the base class should not be called.

Return type

None

class graviti.operation.sheet.CreateSheet(sheet, schema)[source]#

Bases: SheetOperation

This class defines the operation that create a sheet.

Parameters
  • sheet (str) – The sheet name.

  • schema (graviti.portex.record) – The schema of the DataFrame.

execute(self, dataset, draft_number)[source]#

Execute the OpenAPI create sheet.

Parameters
  • dataset (graviti.manager.Dataset) – The Dataset instance.

  • draft_number (int) – The draft number.

Return type

None

class graviti.operation.sheet.DeleteSheet(sheet)[source]#

Bases: SheetOperation

This class defines the operation that delete a sheet.

Parameters

sheet (str) –

execute(self, dataset, draft_number)[source]#

Execute the OpenAPI delete sheet.

Parameters
  • dataset (graviti.manager.Dataset) – The Dataset instance.

  • draft_number (int) – The draft number.

Return type

None