client.tables.patch

A method of the Tables endpoint.

patch(id: int, *, ontology_mapping: dict = None, description: str = None, primary_keys: List[str] = None, last_modified_keys: List[str] = None) Response

Update a table

API URL: PATCH /tables/{id}

import civis
client = civis.APIClient()
response = client.tables.patch(...)
Parameters:
idint

The ID of the table.

ontology_mappingdict, optional

The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.

descriptionstr, optional

The user-defined description of the table.

primary_keysList[str], optional

A list of column(s) which together uniquely identify a row in the data.These columns must not contain NULL values.

last_modified_keysList[str], optional

The columns indicating when a row was last modified.

Returns:
civis.Response
  • idint

    The ID of the table.

  • database_idint

    The ID of the database.

  • schemastr

    The name of the schema containing the table.

  • namestr

    Name of the table.

  • descriptionstr

    The description of the table, as specified by the table owner

  • is_viewbool

    True if this table represents a view. False if it represents a regular table.

  • row_countint

    The number of rows in the table.

  • column_countint

    The number of columns in the table.

  • size_mbfloat (float)

    The size of the table in megabytes.

  • ownerstr

    The database username of the table’s owner.

  • distkeystr

    The column used as the Amazon Redshift distkey.

  • sortkeysstr

    The column used as the Amazon Redshift sortkey.

  • refresh_statusstr

    How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.

  • last_refreshstr (date-time)

    The time of the last statistics refresh.

  • data_updated_atstr (date-time)

    The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • schema_updated_atstr (date-time)

    The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • refresh_idstr

    The ID of the most recent statistics refresh.

  • last_runcivis.Response
    • id : int

    • statestr

      The state of the run. One of queued, running, succeeded, failed or cancelled.

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • primary_keysList[str]

    The primary keys for this table.

  • last_modified_keysList[str]

    The columns indicating an entry’s modification status for this table.

  • table_tagsList[civis.Response]

    The table tags associated with this table.

    • idint

      Table Tag ID

    • namestr

      Table Tag Name

  • ontology_mappingcivis.Response

    The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.