Question: I'm trying to implement Aave flash loan receiver in Vyper <https://developers.aave.com/#implementing-a-flashloanreceiver-contract> and I need to pass it an array of addresses as 'bytes memory \_params' arg. Any ideas how do I encode an array of addresses to bytes in web3 and then decode them back from bytes to address[n] array in Vyper?

Answer: 
If you are going for a piechart, it would require a string legend field and a value on each row for that legens, so union of two results should work:

```
requests
| summarize Success = sumif(itemCount, success == true)
| project Legend = "Success", Value = Success 
| union
(requests
| summarize Failed = sumif(itemCount, success == false)
| project Legend = "Failed", Value = Failed )
| render piechart

```

Going for a barchart would allow to use both `summarize` clauses in one query without join/union and may speed up performance:

```
requests
| summarize Success = sumif(itemCount, success == true), Failed = sumif(itemCount, success == false)
| project Legend = "Status", Success, Failed 
| render barchart 

```

Similarly, to calculate the rate in the same query:

```
requests
| summarize Success = sumif(itemCount, success == true), Failed = sumif(itemCount, success == false)
| extend SuccessRate = Success * 1.0 / (Success + Failed)

```
I'm quite sure it's not the best option an I'm mising something in this query language capabilities, but I could put my request in variable, apply some caching and repeat it twice, I suppose:

```
let dataSource = customEvents
| where name == "RequestEvent" and customDimensions.Condition == "test"
| summarize  requestCount = count()
| extend joinField = "1"
| join ( customEvents
| where name == "SuccessResponseEvent" and customDimensions.Condition == "test"
| summarize  successCount = count()
| extend joinField = "1")
on joinField
| extend successRate = (100 * successCount / requestCount)
| extend failureRate = 100 - successRate;
let cacheddataSource = materialize(dataSource);
cacheddataSource
| project Legend = "Success", Value = successRate
| union (
dataSource
|project Legend = "Failure", Value = failureRate 
) 
| render piechart

```

So, let and materialize more or less helps, maybe some tweaks will be necessary to display actual amount of successes and failures.