Specifies the type of time partitioning to perform. Defaults to DAY. Supported values are: * HOUR * DAY * MONTH * YEAR
field
Optional[str]
If set, the table is partitioned by this field. If not set, the table is partitioned by pseudo column PARTITIONTIME. The field must be a top-level TIMESTAMP, DATETIME, or DATE field. Its mode must be NULLABLE or REQUIRED. See the time-unit column-partitioned tables guide https://cloud.google.com/bigquery/docs/creating-column-partitions in the BigQuery documentation.
expiration_ms
Optional[int]
Number of milliseconds for which to keep the storage for a partition.
Return a TimePartitioning object deserialized from a dict.
This method creates a new TimePartitioning instance that points to
the api_repr parameter as its internal properties dict. This means
that when a TimePartitioning instance is stored as a property of
another object, any changes made at the higher level will also appear
here::
The serialized representation of the TimePartitioning, such as what is output by to_api_repr.
Returns
Type
Description
google.cloud.bigquery.table.TimePartitioning
The TimePartitioning object.
to_api_repr
to_api_repr()-> dict
Return a dictionary representing this object.
This method returns the properties dict of the TimePartitioning
instance rather than making a copy. This means that when a
TimePartitioning instance is stored as a property of another
object, any changes made at the higher level will also appear here.
Returns
Type
Description
dict
A dictionary representing the TimePartitioning object in serialized form.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class TimePartitioning (3.36.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.36.0 (latest)](/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioning)\n- [3.35.1](/python/docs/reference/bigquery/3.35.1/google.cloud.bigquery.table.TimePartitioning)\n- [3.34.0](/python/docs/reference/bigquery/3.34.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.33.0](/python/docs/reference/bigquery/3.33.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.31.0](/python/docs/reference/bigquery/3.31.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.30.0](/python/docs/reference/bigquery/3.30.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.29.0](/python/docs/reference/bigquery/3.29.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.27.0](/python/docs/reference/bigquery/3.27.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.26.0](/python/docs/reference/bigquery/3.26.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.25.0](/python/docs/reference/bigquery/3.25.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.24.0](/python/docs/reference/bigquery/3.24.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.23.1](/python/docs/reference/bigquery/3.23.1/google.cloud.bigquery.table.TimePartitioning)\n- [3.22.0](/python/docs/reference/bigquery/3.22.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.21.0](/python/docs/reference/bigquery/3.21.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.20.1](/python/docs/reference/bigquery/3.20.1/google.cloud.bigquery.table.TimePartitioning)\n- [3.19.0](/python/docs/reference/bigquery/3.19.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.18.0](/python/docs/reference/bigquery/3.18.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.17.2](/python/docs/reference/bigquery/3.17.2/google.cloud.bigquery.table.TimePartitioning)\n- [3.16.0](/python/docs/reference/bigquery/3.16.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.15.0](/python/docs/reference/bigquery/3.15.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.14.1](/python/docs/reference/bigquery/3.14.1/google.cloud.bigquery.table.TimePartitioning)\n- [3.13.0](/python/docs/reference/bigquery/3.13.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.12.0](/python/docs/reference/bigquery/3.12.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.11.4](/python/docs/reference/bigquery/3.11.4/google.cloud.bigquery.table.TimePartitioning)\n- [3.4.0](/python/docs/reference/bigquery/3.4.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.3.6](/python/docs/reference/bigquery/3.3.6/google.cloud.bigquery.table.TimePartitioning)\n- [3.2.0](/python/docs/reference/bigquery/3.2.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.1.0](/python/docs/reference/bigquery/3.1.0/google.cloud.bigquery.table.TimePartitioning)\n- [3.0.1](/python/docs/reference/bigquery/3.0.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.34.4](/python/docs/reference/bigquery/2.34.4/google.cloud.bigquery.table.TimePartitioning)\n- [2.33.0](/python/docs/reference/bigquery/2.33.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.32.0](/python/docs/reference/bigquery/2.32.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.31.0](/python/docs/reference/bigquery/2.31.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.30.1](/python/docs/reference/bigquery/2.30.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.29.0](/python/docs/reference/bigquery/2.29.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.28.1](/python/docs/reference/bigquery/2.28.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.27.1](/python/docs/reference/bigquery/2.27.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.26.0](/python/docs/reference/bigquery/2.26.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.25.2](/python/docs/reference/bigquery/2.25.2/google.cloud.bigquery.table.TimePartitioning)\n- [2.24.1](/python/docs/reference/bigquery/2.24.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.23.3](/python/docs/reference/bigquery/2.23.3/google.cloud.bigquery.table.TimePartitioning)\n- [2.22.1](/python/docs/reference/bigquery/2.22.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.21.0](/python/docs/reference/bigquery/2.21.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.20.0](/python/docs/reference/bigquery/2.20.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.19.0](/python/docs/reference/bigquery/2.19.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.18.0](/python/docs/reference/bigquery/2.18.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.17.0](/python/docs/reference/bigquery/2.17.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.16.1](/python/docs/reference/bigquery/2.16.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.15.0](/python/docs/reference/bigquery/2.15.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.14.0](/python/docs/reference/bigquery/2.14.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.13.1](/python/docs/reference/bigquery/2.13.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.12.0](/python/docs/reference/bigquery/2.12.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.11.0](/python/docs/reference/bigquery/2.11.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.10.0](/python/docs/reference/bigquery/2.10.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.9.0](/python/docs/reference/bigquery/2.9.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.8.0](/python/docs/reference/bigquery/2.8.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.7.0](/python/docs/reference/bigquery/2.7.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.6.2](/python/docs/reference/bigquery/2.6.2/google.cloud.bigquery.table.TimePartitioning)\n- [2.5.0](/python/docs/reference/bigquery/2.5.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.4.0](/python/docs/reference/bigquery/2.4.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.3.1](/python/docs/reference/bigquery/2.3.1/google.cloud.bigquery.table.TimePartitioning)\n- [2.2.0](/python/docs/reference/bigquery/2.2.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.1.0](/python/docs/reference/bigquery/2.1.0/google.cloud.bigquery.table.TimePartitioning)\n- [2.0.0](/python/docs/reference/bigquery/2.0.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.28.2](/python/docs/reference/bigquery/1.28.2/google.cloud.bigquery.table.TimePartitioning)\n- [1.27.2](/python/docs/reference/bigquery/1.27.2/google.cloud.bigquery.table.TimePartitioning)\n- [1.26.1](/python/docs/reference/bigquery/1.26.1/google.cloud.bigquery.table.TimePartitioning)\n- [1.25.0](/python/docs/reference/bigquery/1.25.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.24.0](/python/docs/reference/bigquery/1.24.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.23.1](/python/docs/reference/bigquery/1.23.1/google.cloud.bigquery.table.TimePartitioning)\n- [1.22.0](/python/docs/reference/bigquery/1.22.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.21.0](/python/docs/reference/bigquery/1.21.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.20.0](/python/docs/reference/bigquery/1.20.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.19.0](/python/docs/reference/bigquery/1.19.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.18.0](/python/docs/reference/bigquery/1.18.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.17.0](/python/docs/reference/bigquery/1.17.0/google.cloud.bigquery.table.TimePartitioning)\n- [1.16.0](/python/docs/reference/bigquery/1.16.0/google.cloud.bigquery.table.TimePartitioning) \n\n TimePartitioning(\n type_=None, field=None, expiration_ms=None, require_partition_filter=None\n )\n\nConfigures time-based partitioning for a table.\n\nProperties\n----------\n\n### expiration_ms\n\nint: Number of milliseconds to keep the storage for a partition.\n\n### field\n\nstr: Field in the table to use for partitioning\n\n### require_partition_filter\n\nbool: Specifies whether partition filters are required for queries\n\nDEPRECATED: Use\n[require_partition_filter](/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.Table),\ninstead.\n\n### type_\n\n[google.cloud.bigquery.table.TimePartitioningType](/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType): The type of time\npartitioning to use.\n\nMethods\n-------\n\n### from_api_repr\n\n from_api_repr(api_repr: dict) -\u003e google.cloud.bigquery.table.TimePartitioning\n\nReturn a `TimePartitioning` object deserialized from a dict.\n\nThis method creates a new `TimePartitioning` instance that points to\nthe `api_repr` parameter as its internal properties dict. This means\nthat when a `TimePartitioning` instance is stored as a property of\nanother object, any changes made at the higher level will also appear\nhere:: \n\n \u003e\u003e\u003e time_partitioning = TimePartitioning()\n \u003e\u003e\u003e table.time_partitioning = time_partitioning\n \u003e\u003e\u003e table.time_partitioning.field = 'timecolumn'\n \u003e\u003e\u003e time_partitioning.field\n 'timecolumn'\n\n### to_api_repr\n\n to_api_repr() -\u003e dict\n\nReturn a dictionary representing this object.\n\nThis method returns the properties dict of the `TimePartitioning`\ninstance rather than making a copy. This means that when a\n`TimePartitioning` instance is stored as a property of another\nobject, any changes made at the higher level will also appear here."]]