Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit dc86985

Browse files
committed
fix(ta): computed name issue
seeing an error in sentry where polars is unable to infer the schema because the computed_name is null for a bunch of testruns 2 things: - i don't want the computed name to be null (in the future this logic should live in the test results parser lib) - the polars schema should've been verbose about types from the start to avoid schema inference issues
1 parent c949122 commit dc86985

2 files changed

Lines changed: 21 additions & 20 deletions

File tree

services/test_analytics/ta_cache_rollups.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,32 @@ def rollup_blob_path(repoid: int, branch: str | None = None) -> str:
3636
# so from the time you deprecate an old schema, you only have to keep handling it
3737
# for 60 days
3838
NO_VERSION_POLARS_SCHEMA = [
39-
"computed_name",
39+
("computed_name", pl.String),
4040
("flags", pl.List(pl.String)),
41-
"failing_commits",
42-
"last_duration",
43-
"avg_duration",
44-
"pass_count",
45-
"fail_count",
46-
"flaky_fail_count",
47-
"skip_count",
41+
("failing_commits", pl.Int64),
42+
("last_duration", pl.Float64),
43+
("avg_duration", pl.Float64),
44+
("pass_count", pl.Int64),
45+
("fail_count", pl.Int64),
46+
("flaky_fail_count", pl.Int64),
47+
("skip_count", pl.Int64),
4848
("updated_at", pl.Datetime(time_zone=UTC)),
49-
"timestamp_bin",
49+
("timestamp_bin", pl.Date()),
5050
]
5151

5252
V1_POLARS_SCHEMA = [
53-
"computed_name",
54-
"testsuite",
53+
("computed_name", pl.String),
54+
("testsuite", pl.String),
5555
("flags", pl.List(pl.String)),
56-
"failing_commits",
57-
"last_duration",
58-
"avg_duration",
59-
"pass_count",
60-
"fail_count",
61-
"flaky_fail_count",
62-
"skip_count",
56+
("failing_commits", pl.Int64),
57+
("last_duration", pl.Float64),
58+
("avg_duration", pl.Float64),
59+
("pass_count", pl.Int64),
60+
("fail_count", pl.Int64),
61+
("flaky_fail_count", pl.Int64),
62+
("skip_count", pl.Int64),
6363
("updated_at", pl.Datetime(time_zone=UTC)),
64-
"timestamp_bin",
64+
("timestamp_bin", pl.Date()),
6565
]
6666

6767

services/test_analytics/ta_timeseries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def insert_testrun(
6666
name=testrun["name"],
6767
classname=testrun["classname"],
6868
testsuite=testrun["testsuite"],
69-
computed_name=testrun["computed_name"],
69+
computed_name=testrun["computed_name"]
70+
or f"{testrun['classname']}::{testrun['name']}",
7071
outcome=outcome,
7172
duration_seconds=testrun["duration"],
7273
failure_message=testrun["failure_message"],

0 commit comments

Comments
 (0)