-
Notifications
You must be signed in to change notification settings - Fork 166
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
[feature request] easier API to set table properties #502
Comments
Another workaround can be to use
|
I think this is a great idea @kevinjqliu . Most of the table properties have |
Hi @kevinjqliu @syun64 I think currently we can also set properties using dictionaries, just need properties: Dict[str, str] = {...}
with table.transaction() as transaction:
transaction.set_properties(**properties) This also works for properties having We do similar thing for catalog properties: load_catalog, example passing in glue session properties Do you think the above way is good enough or the |
@HonahX - yes, that's right. We can currently achieve functionally the same thing by providing the properties as **properties into the function call. I guess my point is that, if most of the properties have special characters in them so that they must be passed in as dictionary key values anyways, wouldn't it feel more straightforward for the users if we defined properties as a dictionary type in the first place? Or does it still make sense to keep it as it is because something like below is possible:
or
Where users would appreciate the ability to pass in simpler catalog properties like |
oh wow, thanks @HonahX. I didn't think to pass the properties dictionary as kwargs.
I feel like its hard to make the connection from dictionary to kwargs. And having the ability to pass the dictionary feels more
I'd +1 that change. We might have to support both dictionary and kwargs to keep it backwards compatible, similar to #503
+1 |
Thanks @syun64 @kevinjqliu for the thoughts and explanation. Since users seem to benefit from dictionaries and kwargs, I think it is good idea to support both (as in #503 ) |
Feature Request / Improvement
Background
Currently, there are two ways to set table properties.
in
create_table
, pass inproperties
as dictionaryiceberg-python/tests/catalog/test_sql.py
Line 168 in 29fd42c
using table
set_properties
transaction, pass in as key/value pairiceberg-python/mkdocs/docs/api.md
Lines 483 to 484 in 29fd42c
With the introduction of
TableProperties
, it would be great to make overriding table properties easier.With the current methods, we can only override table properties during
create_table
since this is not valid python:Proposed solution
Allow
set_properties
to take in a dictionary. And also allow the dictionary value to be non-string type (similar to #469)The text was updated successfully, but these errors were encountered: