allow string transforms in add_field()#1883
allow string transforms in add_field()#1883Federico-Vichachi wants to merge 1 commit intoapache:mainfrom Federico-Vichachi:handle-string-transform
Conversation
Fokko
left a comment
There was a problem hiding this comment.
Thanks for picking this up @Federico-Vichachi I left some small comments, and it would be nice to add a test.
It would be good to check locally if the tests pass using make lint and make test.
| self, | ||
| source_column_name: str, | ||
| transform: Transform[Any, Any], | ||
| transform: Union[str, Transform[Any, Any]], # Aceptamos strings o Transform |
There was a problem hiding this comment.
😉
| transform: Union[str, Transform[Any, Any]], # Aceptamos strings o Transform | |
| transform: Union[str, Transform[Any, Any]], # We accept strings or Transform |
|
|
||
| def add_identity(self, source_column_name: str) -> UpdateSpec: |
There was a problem hiding this comment.
I think we need to revert this to make the linter happy:
| def add_identity(self, source_column_name: str) -> UpdateSpec: | |
| def add_identity(self, source_column_name: str) -> UpdateSpec: |
|
Hi @Fokko, I appreciate your corrections and will include them. Regarding the test, I was trying to run the following one but had problems installing the project's dependencies with poetry install. This is the test I want to run in test_partition_evolution.py. |
Closes #1882
Rationale for this change
This change allows the
add_fieldmethod to acceptstrvalues as transform inputs, in addition toTransforminstances. This improves developer experience by supporting more flexible input formats when defining transformations, and is consistent with similar string-based input handling elsewhere in the codebase.Are there any user-facing changes?
No user-facing changes. This is an internal API enhancement that improves developer flexibility when working with partition transforms.