Commit f5978bb
authored
Adds support for creating a GlueCatalog with own client (apache#1920)
Closes apache#1910
# Rationale for this change
When working with the GlueCatalog, I may already have a GlueClient that
I've instantiated from elsewhere, and perhaps wish to keep. This allows
passing our client to the GlueCatalog constructor so that we aren't
forced into getting a new client.
This is slightly interesting because it's the only catalog that now has
a different constructor signature. Also it may be odd for users to pass
a client, but then none of their properties (which may have retry
configs) are applied.
An alternative to consider is having a `from_client` or `with_client`
staticmethod, but I did not see precedence elsewhere. I will leave it to
the maintainers to decide which they prefer and will update accordingly.
Similarly, I can do the same for dynamodb 🙂
I've also skipped the event_handler for a user-provided client because I
wouldn't want to impede on their existing events, also the param is
optional. Something to consider is using the [unique_id
arg](https://github.com/boto/botocore/blob/aaa6690e45c8dabcde3a8d2d1aa34b5fd399fba7/botocore/hooks.py#L89)
when registering an event.
> If a ``unique_id`` is given, the handler will not be registered
> if a handler with the ``unique_id`` has already been registered.
# Are these changes tested?
Basic unit test to assert the client passed is the client used.
# Are there any user-facing changes?
I believe so since this is an addition to the public API.1 parent 0d56a3b commit f5978bb
2 files changed
+45
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
| 306 | + | |
308 | 307 | | |
309 | | - | |
| 308 | + | |
| 309 | + | |
310 | 310 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
329 | 343 | | |
330 | | - | |
331 | | - | |
| 344 | + | |
| 345 | + | |
332 | 346 | | |
333 | 347 | | |
334 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
0 commit comments