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

Simplify the substring column mapping transform configuration #146

Open
riley-harper opened this issue Aug 27, 2024 · 0 comments
Open

Simplify the substring column mapping transform configuration #146

riley-harper opened this issue Aug 27, 2024 · 0 comments
Labels
configuration Related to configuration and its syntax

Comments

@riley-harper
Copy link
Contributor

The substring column mapping transform lets you extract substrings from a string column. Currently, its configuration looks like this:

transforms = [
  {type = "substring", values = [0, 4]}
]

The values array must have length 2. The first element is the starting index of the substring and the second element is its length. This would be simpler and more readable as two separate TOML attributes, like this:

transforms = [
  {type = "substring", start_index = 0, length = 4}
]

The first step would be to deprecate the old values array and support the new attributes. During this step, we would still accept the values array, but we would internally convert it to a start_index and length and print a deprecation message. Then in hlink v4.0 or whenever else we make breaking changes, we could drop support for the values array entirely and just support the separate attributes.

@riley-harper riley-harper added the configuration Related to configuration and its syntax label Aug 27, 2024
@riley-harper riley-harper added this to the v4.0.0 milestone Aug 27, 2024
riley-harper added a commit that referenced this issue Aug 27, 2024
This confirms that the transform handles the case where the values list doesn't
have length 2 by raising an error. This prompted me to make issue #146, which I
think should really simplify this transform.
@riley-harper riley-harper removed this from the v4.0.0 milestone Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Related to configuration and its syntax
Projects
None yet
Development

No branches or pull requests

1 participant