Commit eb9c2af
feat: Add UpdateMode to update_dataset (#2204)
* feat: Add UpdateMode to update_dataset
This commit introduces the `UpdateMode` enum and integrates it into the
`update_dataset` method in the BigQuery client.
The `UpdateMode` enum allows you to specify which parts of a dataset
should be updated (metadata, ACL, or full update).
The following changes were made:
- Defined the `UpdateMode` enum in `google/cloud/bigquery/enums.py`
with values: `UPDATE_MODE_UNSPECIFIED`, `UPDATE_METADATA`,
`UPDATE_ACL`, and `UPDATE_FULL`.
- Modified the `update_dataset` method in
`google/cloud/bigquery/client.py` to accept an optional
`update_mode` parameter. This parameter is added to the query
parameters if provided.
- Added unit tests in `tests/unit/test_client.py` to verify the
correct handling of the `update_mode` parameter, including
testing all enum values and the default case where it's not
provided.
* updates enums, client, and tests
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent b863291 commit eb9c2af
File tree
3 files changed
+132
-1
lines changed- google/cloud/bigquery
- tests/unit
3 files changed
+132
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
1198 | 1199 | | |
1199 | 1200 | | |
1200 | 1201 | | |
| 1202 | + | |
1201 | 1203 | | |
1202 | 1204 | | |
1203 | 1205 | | |
| |||
1237 | 1239 | | |
1238 | 1240 | | |
1239 | 1241 | | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1240 | 1256 | | |
1241 | 1257 | | |
1242 | 1258 | | |
| |||
1250 | 1266 | | |
1251 | 1267 | | |
1252 | 1268 | | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1253 | 1274 | | |
1254 | 1275 | | |
1255 | 1276 | | |
| |||
1259 | 1280 | | |
1260 | 1281 | | |
1261 | 1282 | | |
| 1283 | + | |
1262 | 1284 | | |
1263 | 1285 | | |
1264 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
412 | 430 | | |
413 | 431 | | |
414 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
2101 | 2102 | | |
2102 | 2103 | | |
2103 | 2104 | | |
| 2105 | + | |
2104 | 2106 | | |
2105 | 2107 | | |
2106 | 2108 | | |
| |||
2114 | 2116 | | |
2115 | 2117 | | |
2116 | 2118 | | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
2117 | 2207 | | |
2118 | 2208 | | |
2119 | 2209 | | |
| |||
2145 | 2235 | | |
2146 | 2236 | | |
2147 | 2237 | | |
| 2238 | + | |
2148 | 2239 | | |
2149 | 2240 | | |
2150 | 2241 | | |
| |||
0 commit comments