-
Notifications
You must be signed in to change notification settings - Fork 15
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
[BUG] Enable TableInterpreter
to trim leading and trailing whitespace
#647
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Having it in the TableInterpreter
seems a good solution to me.
We might want to define it column-specific in the future, esp. if we have a nicer syntax to apply transformations. Example (just spitballing):
block TestBlock oftype TableInterpreter {
header: false;
columns: [
"index" oftype integer <- stripWhitespaces,
"name" oftype text,
"flag" oftype boolean <- stripWhitespaces
];\
}
libs/execution/src/lib/types/value-types/internal-representation-parsing.ts
Outdated
Show resolved
Hide resolved
libs/execution/src/lib/types/value-types/internal-representation-parsing.ts
Outdated
Show resolved
Hide resolved
libs/execution/src/lib/types/value-types/internal-representation-parsing.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @georg-schwarz's comments.
We might want to define it column-specific in the future
I agree, but it's something for another PR.
Adds two properties to
TableInterpreter
:skipLeadingWhitespace
andskipTrailingWhitespace
. Both are true by default.If enabled
InternalRepresentationParserVisitor
will trim whitespace forinteger
,decimal
andboolean
.Part of #641.