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

[hail][feature] Add string.translate() #7328

Merged
merged 2 commits into from
Oct 19, 2019

Conversation

tpoterba
Copy link
Contributor

No description provided.

def test_translate(self):
strs = [None, '', 'TATAN']
assert hl.eval(hl.literal(strs, 'array<str>').map(lambda x: x.translate({'T': 'A', 'A': 'T'}))) == [None, '', 'ATATN']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test the error case as well, where the mapping contains strings longer than one character.

@tpoterba tpoterba dismissed johnc1231’s stale review October 19, 2019 15:57

done, good comments

@danking danking merged commit 471d379 into hail-is:master Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants