Skip to content
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][Transform] Add python script tool to Transform #8542

Open
2 of 3 tasks
liugddx opened this issue Jan 16, 2025 · 3 comments
Open
2 of 3 tasks

[Feature][Transform] Add python script tool to Transform #8542

liugddx opened this issue Jan 16, 2025 · 3 comments
Assignees

Comments

@liugddx
Copy link
Member

liugddx commented Jan 16, 2025

Search before asking

  • I had searched in the feature and found no similar feature requirement.

Description

Clean data by writing python scripts.

transform {
Python {
for key, value in input_dict.items():
if key == "name":
cleaned_value = value.strip() if isinstance(value, str) else value
elif key == "age":
try:
cleaned_value = int(value)
except ValueError:
cleaned_value = None
elif key == "email":
cleaned_value = value.lower() if isinstance(value, str) else value
else:
cleaned_value = value
result.append(cleaned_value)
}
}

Usage Scenario

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@liugddx liugddx added transform feature New feature labels Jan 16, 2025
@Hisoka-X
Copy link
Member

+1

@BruceWong96
Copy link
Contributor

+1

@FuYouJ
Copy link
Contributor

FuYouJ commented Jan 21, 2025

Please assign it to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants