feat [python]: Add getter/setter property for writer_bucket_no_key_assigner config#397
Conversation
|
@luoyuxia @fresh-borzoni @leekeiabstraction PTAL. Thanks! |
|
@charlesdong1991 TY for the PR Small comment: strum is already a dep and DataLakeFormat already uses the exact pattern needed, we can do like this: #[derive(..., EnumString, Display)]
#[strum(ascii_case_insensitive)]
pub enum NoKeyAssigner {
#[strum(serialize = "sticky")]
Sticky,
#[strum(serialize = "round_robin")]
RoundRobin,
}Then all 3 sites become value.parse().map_err(...) — same as the numeric fields. Also makes parsing case-insensitive for free. |
|
Good call, we can indeed de-duplicate and clean codebase! @fresh-borzoni 👍 |
|
I did the changes, please let me know if any further changes! Thanks again! @fresh-borzoni |
fresh-borzoni
left a comment
There was a problem hiding this comment.
@charlesdong1991 Ty, LGTM
leekeiabstraction
left a comment
There was a problem hiding this comment.
Ty for the pr!
After my previous PR for updating
writer_bucket_no_key_assignerconfig, I realize unlike other configs, this config does not have getter/setter property.So this PR adds it up. No tests should be needed.