-
Notifications
You must be signed in to change notification settings - Fork 387
Adds support for creating a GlueCatalog with own client #1920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Nice, I can see myself re-using the client I would instantiate in a custom resource to run infra changes on my iceberg tables through CDK! |
|
Thanks for working on this @rchowell I've left some small comments, but it looks good in general 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| if glue_catalog_id := properties.get(GLUE_ID): | ||
| _register_glue_catalog_id_with_glue_client(self.glue, glue_catalog_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we also need to call this when the client is passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinjqliu good question, I left this out intentionally so that we do not make any modifications to the customer's input client / impede on their existing events. Since the catalog_id parameter is optional, it doesn't make a functional difference afaik. Something to consider is using the unique_id arg when registering an event. Let me know what you think, and I can follow-up 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 i think its a good idea to not modify the input client. Its assumed that using the custom client means its already pre-configured before passing here
|
Thanks for the contribution @rchowell! |
3 changes here... 1. Basically a mirror of #1920 but for dynamo 2. Allow users to pass in an existing client/pass initialize client with properties in `RestCatalog` with sigv4 enabled. (closes #2070, closes #2008) 3. Re-use of the client in `add_headers` in `RestCatalog` with sigv4. (closes #2069 ) --------- Co-authored-by: Marko Grujic <[email protected]>
3 changes here... 1. Basically a mirror of apache#1920 but for dynamo 2. Allow users to pass in an existing client/pass initialize client with properties in `RestCatalog` with sigv4 enabled. (closes apache#2070, closes apache#2008) 3. Re-use of the client in `add_headers` in `RestCatalog` with sigv4. (closes apache#2069 ) --------- Co-authored-by: Marko Grujic <[email protected]>
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.
3 changes here... 1. Basically a mirror of apache#1920 but for dynamo 2. Allow users to pass in an existing client/pass initialize client with properties in `RestCatalog` with sigv4 enabled. (closes apache#2070, closes apache#2008) 3. Re-use of the client in `add_headers` in `RestCatalog` with sigv4. (closes apache#2069 ) --------- Co-authored-by: Marko Grujic <[email protected]>
Closes #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_clientorwith_clientstaticmethod, 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 when registering an event.
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.