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

[BUG] #138

Open
kurtlawrence opened this issue Jul 11, 2022 · 0 comments
Open

[BUG] #138

kurtlawrence opened this issue Jul 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kurtlawrence
Copy link
Member

kurtlawrence commented Jul 11, 2022

Current Behaviour

Following on from #137, this code (with the variable defined, but an extra line) makes slow compilation.

# Returns a table with the following headers:
# `P20,P50,P80,σ`
def sim-characteristics Table (col:Str) {
    let {len} $len
    | let { fold 0 + { \ $row | get $col} | / $len } $mean
    | Table 'mean'
    | append-row $mean
}

# Construct the Saleable by year table.
open input-constrained.csv | grp-by {get:Str Period | take 4} | map value { grp Run 
    | map value fold 0 + $row.SaleableTonnesMprd | ren value Saleable }
| map value sim-characteristics Saleable
| fold {Table} + { \ $row | get value | append --Year $row.key }
| save saleable-table.csv

Typing $row.key:Str fixes the issue.

Expected Behaviour

Reproduction Steps

Additional information

@kurtlawrence kurtlawrence added the bug Something isn't working label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant