Skip to content

Commit

Permalink
tc
Browse files Browse the repository at this point in the history
  • Loading branch information
clee2000 committed Jan 29, 2025
1 parent bc182a2 commit bcddc84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions torchci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ To get access to ClickHouse Cloud's console, please see
[here](https://github.com/pytorch/test-infra/wiki/Querying-ClickHouse-database-for-fun-and-profit#prerequisites).

### `params.json`

An example `params.json` file with params and tests:

```
{
"params": {
Expand All @@ -112,6 +114,7 @@ An example `params.json` file with params and tests:
]
}
```

A test can set a parameter to be a dictionary with the field `from_now` to get a
dynamic timestamp where the entry is the difference from now in days. For
example `from_now: 0` is now and `from_now: -7` would be 7 days in the past.
Expand Down
3 changes: 2 additions & 1 deletion torchci/lib/clickhouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export async function queryClickhouseSaved(
`${process.cwd()}/clickhouse_queries/${queryName}/query.sql`,
"utf8"
);
let paramsText = require(`clickhouse_queries/${queryName}/params.json`).params;
let paramsText =
require(`clickhouse_queries/${queryName}/params.json`).params;
if (paramsText === undefined) {
paramsText = {};
}
Expand Down

0 comments on commit bcddc84

Please sign in to comment.