Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
412dfc5
[Autoloop: tsb-perf-evolve] Iteration 47: per-instance Series result …
github-actions[bot] May 16, 2026
cbb2e30
chore: trigger CI [evergreen]
mrjf May 16, 2026
c0d97e4
Merge remote-tracking branch 'origin/main' into autoloop/tsb-perf-evolve
github-actions[bot] May 27, 2026
32e8793
fix: replace nested ternary with if-else to satisfy noNestedTernary lint
github-actions[bot] May 27, 2026
27e3e26
chore: trigger CI [evergreen]
mrjf May 27, 2026
6352e2a
fix: combine two-statement switch cases into single return statements
github-actions[bot] May 27, 2026
d7817ca
chore: trigger CI [evergreen]
mrjf May 27, 2026
fb1c921
fix: resolve noVoidTypeReturn and noMisplacedAssertion lint errors
github-actions[bot] May 27, 2026
8127e0c
chore: trigger CI [evergreen]
mrjf May 27, 2026
72d6bae
fix: format series.ts array literal per biome rules
github-actions[bot] May 27, 2026
0cafa65
chore: trigger CI [evergreen]
mrjf May 28, 2026
4c01952
[Autoloop: tsb-perf-evolve] Iteration 62: named-property cache — elim…
github-actions[bot] May 28, 2026
d68c8c3
chore: trigger CI [evergreen]
mrjf May 28, 2026
c8e1138
[Autoloop: tsb-perf-evolve] Iteration 63: flat nested-if cache — elim…
github-actions[bot] May 29, 2026
ef42578
chore: trigger CI [evergreen]
mrjf May 29, 2026
3f63248
[Autoloop: tsb-perf-evolve] Iteration 64: extract cold sort path to _…
github-actions[bot] May 30, 2026
5366166
chore: trigger CI [evergreen]
mrjf May 30, 2026
6253606
[Autoloop: tsb-perf-evolve] Iteration 65: restore ternary cache selec…
github-actions[bot] May 30, 2026
8d25646
chore: trigger CI [evergreen]
mrjf May 30, 2026
1bd99d3
[Autoloop: tsb-perf-evolve] Iteration 66: inline sortValues cold path…
github-actions[bot] May 31, 2026
5dddae1
chore: trigger CI [evergreen]
mrjf May 31, 2026
6103574
fix(lint): reduce cognitive complexity of inferDtype by extracting re…
github-actions[bot] May 31, 2026
ffc6c05
chore: trigger CI [evergreen]
mrjf May 31, 2026
6eb0bc5
fix(lint): fix biome errors in sortValues cache implementation
github-actions[bot] May 31, 2026
ef3e167
chore: trigger CI [evergreen]
mrjf May 31, 2026
02c7f40
fix: format inline if-bodies in sortValues to pass biome check
github-actions[bot] May 31, 2026
ff11a33
chore: trigger CI [evergreen]
mrjf May 31, 2026
3a2529a
[Autoloop: tsb-perf-evolve] Iteration 68: remove module-level sort-re…
github-actions[bot] Jun 1, 2026
eacefe2
chore: trigger CI [evergreen]
mrjf Jun 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 14 additions & 25 deletions src/core/pd_array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,46 +88,35 @@ function classifyScalar(v: Scalar): "date" | "bigint" | "float" | "int" | "strin
}

function inferDtype(data: readonly Scalar[]): DtypeName {
let hasFloat = false;
let hasInt = false;
let hasString = false;
let hasBool = false;
let hasDate = false;
let hasBigInt = false;

const kinds = new Set<"date" | "bigint" | "float" | "int" | "string" | "bool">();
for (const v of data) {
const kind = classifyScalar(v);
if (kind === "date") {
hasDate = true;
} else if (kind === "bigint") {
hasBigInt = true;
} else if (kind === "float") {
hasFloat = true;
} else if (kind === "int") {
hasInt = true;
} else if (kind === "string") {
hasString = true;
} else if (kind === "bool") {
hasBool = true;
if (kind !== null) {
kinds.add(kind);
}
}
return resolveDtype(kinds);
}

if (hasDate) {
function resolveDtype(
kinds: ReadonlySet<"date" | "bigint" | "float" | "int" | "string" | "bool">,
): DtypeName {
if (kinds.has("date")) {
return "datetime";
}
if (hasBigInt) {
if (kinds.has("bigint")) {
return "int64";
}
if (hasFloat) {
if (kinds.has("float")) {
return "float64";
}
if (hasInt && !hasString && !hasBool) {
if (kinds.has("int") && !kinds.has("string") && !kinds.has("bool")) {
return "int64";
}
if (hasBool && !hasInt && !hasFloat && !hasString) {
if (kinds.has("bool") && !kinds.has("int") && !kinds.has("float") && !kinds.has("string")) {
return "bool";
}
if (hasString) {
if (kinds.has("string")) {
return "string";
}
return "object";
Expand Down
Loading
Loading