Uh oh!
There was an error while loading. Please reload this page.
feat!: Require parentheses around pipelines - #4775
Conversation
snth
commented
Jul 23, 2024
It does make a lot of sense for those parsing error examples that you show. It's a pity though for the common use cases like Would it be possible to require it only in cases where there's a >>>s='a''b'>>>s'ab'>>>s= ('a'
... 'b')
>>>s'ab' |
snth
commented
Jul 23, 2024
Or if one conceptually separated the two uses of What I mean is, assume one used from customers
derive upper_title = title | text.upperWhile I usually want to use from customers
derive upper_title =(title |...|...|
text.upper)or from customers
derive upper_title =(title | text.upper)but never from customers
derive upper_title =(title text.upper)or from customers
derive upper_title = title text.upper |
max-sixty
commented
Jul 23, 2024
I think any deviation away from " |
Need to add some parentheses docs but otherwise this is ready to go! Edit: actually the docs were already up-to-date... the code behavior was overly permissive and we didn't check for an error |
Whether pipelines required parentheses was ambiguous before — does
select (invoice_date | date.to_text "%d/%m/%Y")require its parentheses? How about in a tuple likeselect {(invoice_date | date.to_text "%d/%m/%Y")}?This changes the parser so parentheses are required. This creates much better errors in some cases — for example a missing comma from a tuple isn't parsed as a pipeline:
...is no longer parsed as
derive {x=(y | a=b)}, which is really confusing. Or similarlyderive {x=y a=b}also parses into that.It also simplifies the parser code slightly; unifying
pipelinefunctions.(tests fail on parsing one thing from the std lib, I need to fix)