Update expression parser to support indirect column name references?
See original GitHub issueThe following code (within an observable notebook cell) runs just fine:
{
let df = aq.from([{ a: 1 }, { a: 2 }]);
return df.derive({ b: row => row['a'] + 1 }).view(10);
}
But if I try and make the column name a variable, it fails:
{
let df = aq.from([{ a: 1 }, { a: 2 }]);
let col = 'a';
return df.derive({ b: row => row[col] + 1 }).view(10);
}
I suppose I’m just not understanding the scope in which the lambda gets evaluated, or something. What is the right way to use variable names within the lambdas that get passed to derive
?
Notebook: https://observablehq.com/@pwills/arquero-confusions
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
how to reference column name in expression for upd...
I'm trying to build a flow that references the column name in the excel 'update a row in a table' connector via expression...
Read more >Referring to data.table columns by names saved in variables
I know one way to extract the string name from a quoted expression - it's not pretty, but it works. Here's an example...
Read more >Excel INDIRECT function - basic uses and formula examples
The INDIRECT function in Excel returns a cell reference from a text ... And now, all you have to do is to enter...
Read more >Formula Parse Errors In Google Sheets And How To Fix Them
I'll help you understand and fix Google Sheets formula parse errors, ... Another reason for a #NAME? error is referencing a named range...
Read more >Update expressions - Amazon DynamoDB
Update the ProductCategory and Price attributes. aws dynamodb update-item \ --table-name ProductCatalog \ --key '{"Id": ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Arquero v2.1.3 includes a fix so that you should now be able to use params and self-contained expressions to specify column name references. The importable Arquero observable notebook has also been updated.
or