You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add migration guide from version 2.x to 3.x (#1027)
* docs: add migration guide from version 2.x. to 3.x
* Add a section on typee annotations
* Explain additional requirement of pandas extra
* Mention new default type for TZ-aware datetimes
* rearrange and add a section
* start documenting model properties that have changed
* add table of changes for pandas and Model
Co-authored-by: Tim Swast <[email protected]>
## Changes to data types loading a pandas DataFrame
150
+
151
+
In the absence of schema information, pandas columns with naive
152
+
`datetime64[ns]` values, i.e. without timezone information, are recognized and
153
+
loaded using the `DATETIME` type. On the other hand, for columns with
154
+
timezone-aware `datetime64[ns, UTC]` values, the `TIMESTAMP` type is continued
155
+
to be used.
156
+
157
+
## Changes to `Model`, `Client.get_model`, `Client.update_model`, and `Client.list_models`
158
+
159
+
The types of several `Model` properties have been changed.
160
+
161
+
-`Model.feature_columns` now returns a sequence of `google.cloud.bigquery.standard_sql.StandardSqlField`.
162
+
-`Model.label_columns` now returns a sequence of `google.cloud.bigquery.standard_sql.StandardSqlField`.
163
+
-`Model.model_type` now returns a string.
164
+
-`Model.training_runs` now returns a sequence of dictionaries, as recieved from the [BigQuery REST API](https://cloud.google.com/bigquery/docs/reference/rest/v2/models#Model.FIELDS.training_runs).
165
+
166
+
<aname="legacy-protobuf-types"></a>
167
+
## Legacy Protocol Buffers Types
168
+
169
+
For compatibility reasons, the legacy proto-based types still exists as static code
170
+
and can be imported:
171
+
172
+
```py
173
+
from google.cloud.bigquery_v2 import Model # a sublcass of proto.Message
174
+
```
175
+
176
+
Mind, however, that importing them will issue a warning, because aside from
177
+
being importable, these types **are not maintained anymore**. They may differ
178
+
both from the types in `google.cloud.bigquery`, and from the types supported on
179
+
the backend.
180
+
181
+
### Maintaining compatibility with `google-cloud-bigquery` version 2.0
182
+
183
+
If you maintain a library or system that needs to support both
184
+
`google-cloud-bigquery` version 2.x and 3.x, it is recommended that you detect
185
+
when version 2.x is in use and convert properties that use the legacy protocol
186
+
buffer types, such as `Model.training_runs`, into the types used in 3.x.
0 commit comments