Open irnc opened 2 weeks ago
@irnc
What exactly is the discrepency here Even if the make-series
returns string[]
it is returned correctly. (Because of the [][]
outside the brackets). I have written a sample program to verify this behavior:
import { DefaultAzureCredential } from "@azure/identity";
import { LogsQueryClient, LogsQueryResult, LogsQuerySuccessfulResult } from "@azure/monitor-query";
async function main() {
const tokenCredential = new DefaultAzureCredential();
const logsQueryClient = new LogsQueryClient(tokenCredential);
const result: LogsQueryResult = await logsQueryClient.queryWorkspace("<YOUR_WORKSPACE_ID>",
`Usage | limit 100 | make-series count() on TimeGenerated from ago(10d) to now() step 1h`,
{
startTime: new Date(new Date().getTime() - 24 * 60 * 60 * 10000),
endTime: new Date(),
});
console.log((result as LogsQuerySuccessfulResult).tables[0].rows[0][0]);//The rows[0][0] itself is an array.
}
main();
If you face any more issues, please let me know. Else, could you give me an example of the problem, with explanation, that you are facing? Thanks.
What exactly is the discrepency here Even if the
make-series
returnsstring[]
it is returned correctly. (Because of the[][]
outside the brackets). I have written a sample program to verify this behavior:
[][]
denounce the row index and column index, while inside a column value there could be another array of string or number type.
I have an issue with this because in tests we have a fixture of a response, which is passed to function parameter of type LogsQuerySuccessfulResult
. This code doesn't pass type-check because fixture has string[]
inside rows[0][0]
, while string[]
is not part of rows[][]
type definition.
@azure/monitor-query
1.1.1
Describe the bug Cell value in results row are defined as
Date | string | number | Record<string, unknown> | boolean
.https://github.com/Azure/azure-sdk-for-js/blob/9488fe4bd780306e2f00eaa1509eba20982215f4/sdk/monitor/monitor-query/src/models/publicLogsModels.ts#L164
Query with
make-series
creates cell value of typestring[]
. Whileseries_decompose
creates values ofnumber[]
.Expected behavior Cell value type should be extended to include
string[] | number[]
, i.e.rows: (Date | string | number | Record<string, unknown> | boolean | string[] | number[])[][];