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

refactor csv string parameter handling - fix empty string to array split #1362

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

jfchevrette
Copy link
Collaborator

What this PR does

split when passed an empty string, will return an array with the empty string as the first element, even if there were no occurrences of the split delimiter. In our use case, we actually want no items in the array if there were no items in the string (empty string should be considered no item)

This current breaks the case when no availability zones are passed (either by the use of an empty array or by passing an empty string)

Example showing what happens

var emptyArray = []
var joinEmptyArray = join(emptyArray, ',') // => ""
var splitEmptyString = split(joinEmptyArray, ',') // => [""]

The change improves the param description and adds helper functions which help clarify the intent and makes it reusable

Jira:
Link to demo recording:

Special notes for your reviewer

@jfchevrette jfchevrette merged commit 89a9d44 into main Feb 18, 2025
22 checks passed
@jfchevrette jfchevrette deleted the push-qvmxlvtuzmtr branch February 18, 2025 14:39
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.

2 participants