data-finder-ts 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -55
- package/dist/{chunk-V647VNMY.js → chunk-4JVW4TAB.js} +59 -14
- package/dist/chunk-4JVW4TAB.js.map +1 -0
- package/dist/{chunk-5K2Z3YDY.js → chunk-4LNZV6EN.js} +138 -31
- package/dist/chunk-4LNZV6EN.js.map +1 -0
- package/dist/{chunk-6QTCGJWX.js → chunk-FJYA2ASS.js} +46 -8
- package/dist/chunk-FJYA2ASS.js.map +1 -0
- package/dist/{chunk-DFYZVBII.js → chunk-MH4XMYVB.js} +186 -142
- package/dist/chunk-MH4XMYVB.js.map +1 -0
- package/dist/{chunk-EYXBYV2X.js → chunk-PMPLCEWQ.js} +2 -2
- package/dist/{chunk-3SSWFES4.js → chunk-UYMOE6YU.js} +64 -3
- package/dist/chunk-UYMOE6YU.js.map +1 -0
- package/dist/datafinder/attribute.cjs +64 -13
- package/dist/datafinder/attribute.cjs.map +1 -1
- package/dist/datafinder/attribute.d.cts +48 -7
- package/dist/datafinder/attribute.d.ts +48 -7
- package/dist/datafinder/attribute.js +2 -2
- package/dist/datafinder/runner.cjs +389 -140
- package/dist/datafinder/runner.cjs.map +1 -1
- package/dist/datafinder/runner.d.cts +14 -3
- package/dist/datafinder/runner.d.ts +14 -3
- package/dist/datafinder/runner.js +12 -6
- package/dist/datafinder/sql-generator.cjs +344 -138
- package/dist/datafinder/sql-generator.cjs.map +1 -1
- package/dist/datafinder/sql-generator.d.cts +4 -13
- package/dist/datafinder/sql-generator.d.ts +4 -13
- package/dist/datafinder/sql-generator.js +5 -7
- package/dist/datafinder/typed-attributes.cjs +199 -41
- package/dist/datafinder/typed-attributes.cjs.map +1 -1
- package/dist/datafinder/typed-attributes.d.cts +120 -13
- package/dist/datafinder/typed-attributes.d.ts +120 -13
- package/dist/datafinder/typed-attributes.js +3 -3
- package/dist/index.cjs +507 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -15
- package/dist/index.d.ts +16 -15
- package/dist/index.js +49 -9
- package/dist/index.js.map +1 -1
- package/dist/model/milestoning.cjs.map +1 -1
- package/dist/model/milestoning.js +2 -2
- package/dist/model/relational.cjs +66 -1
- package/dist/model/relational.cjs.map +1 -1
- package/dist/model/relational.d.cts +47 -2
- package/dist/model/relational.d.ts +47 -2
- package/dist/model/relational.js +9 -1
- package/package.json +4 -2
- package/dist/chunk-3SSWFES4.js.map +0 -1
- package/dist/chunk-5K2Z3YDY.js.map +0 -1
- package/dist/chunk-6QTCGJWX.js.map +0 -1
- package/dist/chunk-DFYZVBII.js.map +0 -1
- package/dist/chunk-V647VNMY.js.map +0 -1
- /package/dist/{chunk-EYXBYV2X.js.map → chunk-PMPLCEWQ.js.map} +0 -0
|
@@ -5,39 +5,80 @@ declare abstract class Attribute {
|
|
|
5
5
|
private readonly _column;
|
|
6
6
|
private readonly _owner;
|
|
7
7
|
private readonly _parent?;
|
|
8
|
-
|
|
8
|
+
private readonly _embedded?;
|
|
9
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
9
10
|
column(): Column;
|
|
10
11
|
owner(): string;
|
|
11
12
|
parent(): JoinTreeNodeOperation | undefined;
|
|
12
13
|
displayName(): string;
|
|
14
|
+
/** Alternate attribute on a flat column of the owning table, used in place of this one when its join is elided. */
|
|
15
|
+
embedded(): Attribute | undefined;
|
|
13
16
|
cwj(): ColumnWithJoin;
|
|
17
|
+
/** Count the number of non-null values. Use in a projection with `groupByOp` to aggregate per group. */
|
|
14
18
|
count(): AggregateOperation;
|
|
19
|
+
/** Sort this attribute in ascending order. Pass to `orderByOp` or a window function's `orderBy`. */
|
|
15
20
|
ascending(): SortOperation;
|
|
21
|
+
/** Sort this attribute in descending order. Pass to `orderByOp` or a window function's `orderBy`. */
|
|
16
22
|
descending(): SortOperation;
|
|
23
|
+
/** Filter to rows where this attribute has no value. */
|
|
17
24
|
isNull(): IsNullOperation;
|
|
25
|
+
/** Filter to rows where this attribute has a value. */
|
|
18
26
|
isNotNull(): IsNotNullOperation;
|
|
19
27
|
private _windowSpec;
|
|
28
|
+
/**
|
|
29
|
+
* Assign a rank to each row within the ordered window, following pandas `Series.rank` conventions.
|
|
30
|
+
*
|
|
31
|
+
* `method` controls tie-breaking (default `'min'`):
|
|
32
|
+
* - `'min'` — tied rows share the lowest rank; the next rank skips.
|
|
33
|
+
* - `'dense'` — like `'min'` but ranks are contiguous (no gaps).
|
|
34
|
+
* - `'first'` — each row gets a unique sequential integer (no ties).
|
|
35
|
+
* - `'max'` — only meaningful with `pct: true` (see below).
|
|
36
|
+
*
|
|
37
|
+
* When `pct: true` the result is a relative rank between 0 and 1:
|
|
38
|
+
* - `method: 'min'` (default) → fraction of values strictly below this row (PERCENT_RANK).
|
|
39
|
+
* - `method: 'max'` → fraction of values at or below this row (cumulative distribution).
|
|
40
|
+
*
|
|
41
|
+
* `partitionBy` restarts the ranking within each group of distinct values.
|
|
42
|
+
*/
|
|
20
43
|
rank(opts?: {
|
|
21
|
-
method?: 'min' | 'dense' | 'first';
|
|
44
|
+
method?: 'min' | 'dense' | 'first' | 'max';
|
|
22
45
|
pct?: boolean;
|
|
23
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
46
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
24
47
|
orderBy?: SortOperation | SortOperation[];
|
|
25
48
|
}): WindowFunctionOperation;
|
|
49
|
+
/**
|
|
50
|
+
* Split rows into `buckets` equal-sized quantile bins ordered by `orderBy`.
|
|
51
|
+
* Each row receives a bucket number from 1 (lowest) to `buckets` (highest).
|
|
52
|
+
* Named after `pandas.qcut`.
|
|
53
|
+
*/
|
|
26
54
|
qcut(buckets: number, opts?: {
|
|
27
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
55
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
28
56
|
orderBy?: SortOperation | SortOperation[];
|
|
29
57
|
}): WindowFunctionOperation;
|
|
58
|
+
/**
|
|
59
|
+
* Return the value of this attribute from `periods` rows earlier (positive) or later (negative)
|
|
60
|
+
* within the ordered window, following `pandas.Series.shift`.
|
|
61
|
+
* Rows with no neighbour at the given offset return `null` (or `fillValue` if provided).
|
|
62
|
+
*/
|
|
30
63
|
shift(periods?: number, opts?: {
|
|
31
64
|
fillValue?: string | number;
|
|
32
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
65
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
33
66
|
orderBy?: SortOperation | SortOperation[];
|
|
34
67
|
}): WindowFunctionOperation;
|
|
68
|
+
/**
|
|
69
|
+
* Return the first value of this attribute in the window frame.
|
|
70
|
+
* Use `partitionBy` to restart the frame for each group.
|
|
71
|
+
*/
|
|
35
72
|
first(opts?: {
|
|
36
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
73
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
37
74
|
orderBy?: SortOperation | SortOperation[];
|
|
38
75
|
}): WindowFunctionOperation;
|
|
76
|
+
/**
|
|
77
|
+
* Return the last value of this attribute in the window frame.
|
|
78
|
+
* Use `partitionBy` to restart the frame for each group.
|
|
79
|
+
*/
|
|
39
80
|
last(opts?: {
|
|
40
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
81
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
41
82
|
orderBy?: SortOperation | SortOperation[];
|
|
42
83
|
}): WindowFunctionOperation;
|
|
43
84
|
}
|
|
@@ -5,39 +5,80 @@ declare abstract class Attribute {
|
|
|
5
5
|
private readonly _column;
|
|
6
6
|
private readonly _owner;
|
|
7
7
|
private readonly _parent?;
|
|
8
|
-
|
|
8
|
+
private readonly _embedded?;
|
|
9
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
9
10
|
column(): Column;
|
|
10
11
|
owner(): string;
|
|
11
12
|
parent(): JoinTreeNodeOperation | undefined;
|
|
12
13
|
displayName(): string;
|
|
14
|
+
/** Alternate attribute on a flat column of the owning table, used in place of this one when its join is elided. */
|
|
15
|
+
embedded(): Attribute | undefined;
|
|
13
16
|
cwj(): ColumnWithJoin;
|
|
17
|
+
/** Count the number of non-null values. Use in a projection with `groupByOp` to aggregate per group. */
|
|
14
18
|
count(): AggregateOperation;
|
|
19
|
+
/** Sort this attribute in ascending order. Pass to `orderByOp` or a window function's `orderBy`. */
|
|
15
20
|
ascending(): SortOperation;
|
|
21
|
+
/** Sort this attribute in descending order. Pass to `orderByOp` or a window function's `orderBy`. */
|
|
16
22
|
descending(): SortOperation;
|
|
23
|
+
/** Filter to rows where this attribute has no value. */
|
|
17
24
|
isNull(): IsNullOperation;
|
|
25
|
+
/** Filter to rows where this attribute has a value. */
|
|
18
26
|
isNotNull(): IsNotNullOperation;
|
|
19
27
|
private _windowSpec;
|
|
28
|
+
/**
|
|
29
|
+
* Assign a rank to each row within the ordered window, following pandas `Series.rank` conventions.
|
|
30
|
+
*
|
|
31
|
+
* `method` controls tie-breaking (default `'min'`):
|
|
32
|
+
* - `'min'` — tied rows share the lowest rank; the next rank skips.
|
|
33
|
+
* - `'dense'` — like `'min'` but ranks are contiguous (no gaps).
|
|
34
|
+
* - `'first'` — each row gets a unique sequential integer (no ties).
|
|
35
|
+
* - `'max'` — only meaningful with `pct: true` (see below).
|
|
36
|
+
*
|
|
37
|
+
* When `pct: true` the result is a relative rank between 0 and 1:
|
|
38
|
+
* - `method: 'min'` (default) → fraction of values strictly below this row (PERCENT_RANK).
|
|
39
|
+
* - `method: 'max'` → fraction of values at or below this row (cumulative distribution).
|
|
40
|
+
*
|
|
41
|
+
* `partitionBy` restarts the ranking within each group of distinct values.
|
|
42
|
+
*/
|
|
20
43
|
rank(opts?: {
|
|
21
|
-
method?: 'min' | 'dense' | 'first';
|
|
44
|
+
method?: 'min' | 'dense' | 'first' | 'max';
|
|
22
45
|
pct?: boolean;
|
|
23
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
46
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
24
47
|
orderBy?: SortOperation | SortOperation[];
|
|
25
48
|
}): WindowFunctionOperation;
|
|
49
|
+
/**
|
|
50
|
+
* Split rows into `buckets` equal-sized quantile bins ordered by `orderBy`.
|
|
51
|
+
* Each row receives a bucket number from 1 (lowest) to `buckets` (highest).
|
|
52
|
+
* Named after `pandas.qcut`.
|
|
53
|
+
*/
|
|
26
54
|
qcut(buckets: number, opts?: {
|
|
27
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
55
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
28
56
|
orderBy?: SortOperation | SortOperation[];
|
|
29
57
|
}): WindowFunctionOperation;
|
|
58
|
+
/**
|
|
59
|
+
* Return the value of this attribute from `periods` rows earlier (positive) or later (negative)
|
|
60
|
+
* within the ordered window, following `pandas.Series.shift`.
|
|
61
|
+
* Rows with no neighbour at the given offset return `null` (or `fillValue` if provided).
|
|
62
|
+
*/
|
|
30
63
|
shift(periods?: number, opts?: {
|
|
31
64
|
fillValue?: string | number;
|
|
32
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
65
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
33
66
|
orderBy?: SortOperation | SortOperation[];
|
|
34
67
|
}): WindowFunctionOperation;
|
|
68
|
+
/**
|
|
69
|
+
* Return the first value of this attribute in the window frame.
|
|
70
|
+
* Use `partitionBy` to restart the frame for each group.
|
|
71
|
+
*/
|
|
35
72
|
first(opts?: {
|
|
36
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
73
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
37
74
|
orderBy?: SortOperation | SortOperation[];
|
|
38
75
|
}): WindowFunctionOperation;
|
|
76
|
+
/**
|
|
77
|
+
* Return the last value of this attribute in the window frame.
|
|
78
|
+
* Use `partitionBy` to restart the frame for each group.
|
|
79
|
+
*/
|
|
39
80
|
last(opts?: {
|
|
40
|
-
partitionBy?: ColumnWithJoin | ColumnWithJoin[];
|
|
81
|
+
partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];
|
|
41
82
|
orderBy?: SortOperation | SortOperation[];
|
|
42
83
|
}): WindowFunctionOperation;
|
|
43
84
|
}
|