@ohos-ports/nodejs-polars 0.23.4-beta.0
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/LICENSE +19 -0
- package/README.md +217 -0
- package/bin/cfg.d.ts +156 -0
- package/bin/cfg.js +52 -0
- package/bin/dataframe.d.ts +2135 -0
- package/bin/dataframe.js +783 -0
- package/bin/datatypes/conversion.d.ts +2 -0
- package/bin/datatypes/conversion.js +2 -0
- package/bin/datatypes/datatype.d.ts +285 -0
- package/bin/datatypes/datatype.js +430 -0
- package/bin/datatypes/field.d.ts +26 -0
- package/bin/datatypes/field.js +36 -0
- package/bin/datatypes/index.d.ts +43 -0
- package/bin/datatypes/index.js +120 -0
- package/bin/error.d.ts +7 -0
- package/bin/error.js +17 -0
- package/bin/functions.d.ts +26 -0
- package/bin/functions.js +208 -0
- package/bin/groupby.d.ts +212 -0
- package/bin/groupby.js +156 -0
- package/bin/html.d.ts +4 -0
- package/bin/html.js +18 -0
- package/bin/index.d.ts +256 -0
- package/bin/index.js +267 -0
- package/bin/internals/construction.d.ts +7 -0
- package/bin/internals/construction.js +256 -0
- package/bin/internals/polars_internal.d.ts +2 -0
- package/bin/internals/polars_internal.js +7 -0
- package/bin/io.d.ts +433 -0
- package/bin/io.js +344 -0
- package/bin/lazy/dataframe.d.ts +785 -0
- package/bin/lazy/dataframe.js +427 -0
- package/bin/lazy/expr/datetime.d.ts +8 -0
- package/bin/lazy/expr/datetime.js +27 -0
- package/bin/lazy/expr/index.d.ts +1152 -0
- package/bin/lazy/expr/index.js +632 -0
- package/bin/lazy/expr/list.d.ts +8 -0
- package/bin/lazy/expr/list.js +115 -0
- package/bin/lazy/expr/string.d.ts +534 -0
- package/bin/lazy/expr/string.js +131 -0
- package/bin/lazy/expr/struct.d.ts +126 -0
- package/bin/lazy/expr/struct.js +26 -0
- package/bin/lazy/functions.d.ts +612 -0
- package/bin/lazy/functions.js +687 -0
- package/bin/lazy/groupby.d.ts +29 -0
- package/bin/lazy/groupby.js +30 -0
- package/bin/lazy/index.d.ts +4 -0
- package/bin/lazy/index.js +20 -0
- package/bin/lazy/whenthen.d.ts +67 -0
- package/bin/lazy/whenthen.js +81 -0
- package/bin/native-polars.d.ts +2 -0
- package/bin/native-polars.js +267 -0
- package/bin/series/datetime.d.ts +8 -0
- package/bin/series/datetime.js +34 -0
- package/bin/series/index.d.ts +1135 -0
- package/bin/series/index.js +700 -0
- package/bin/series/list.d.ts +8 -0
- package/bin/series/list.js +87 -0
- package/bin/series/string.d.ts +300 -0
- package/bin/series/string.js +125 -0
- package/bin/series/struct.d.ts +36 -0
- package/bin/series/struct.js +35 -0
- package/bin/shared_traits.d.ts +1458 -0
- package/bin/shared_traits.js +2 -0
- package/bin/sql.d.ts +244 -0
- package/bin/sql.js +63 -0
- package/bin/types.d.ts +287 -0
- package/bin/types.js +2 -0
- package/bin/utils.d.ts +38 -0
- package/bin/utils.js +69 -0
- package/package.json +45 -0
package/bin/io.js
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readRecords = readRecords;
|
|
7
|
+
exports.readCSV = readCSV;
|
|
8
|
+
exports.scanCSV = scanCSV;
|
|
9
|
+
exports.readJSON = readJSON;
|
|
10
|
+
exports.scanJson = scanJson;
|
|
11
|
+
exports.readParquet = readParquet;
|
|
12
|
+
exports.readAvro = readAvro;
|
|
13
|
+
exports.scanParquet = scanParquet;
|
|
14
|
+
exports.readIPC = readIPC;
|
|
15
|
+
exports.readIPCStream = readIPCStream;
|
|
16
|
+
exports.scanIPC = scanIPC;
|
|
17
|
+
exports.readCSVStream = readCSVStream;
|
|
18
|
+
exports.readJSONStream = readJSONStream;
|
|
19
|
+
const node_stream_1 = require("node:stream");
|
|
20
|
+
const dataframe_1 = require("./dataframe");
|
|
21
|
+
const functions_1 = require("./functions");
|
|
22
|
+
const polars_internal_1 = __importDefault(require("./internals/polars_internal"));
|
|
23
|
+
const dataframe_2 = require("./lazy/dataframe");
|
|
24
|
+
const utils_1 = require("./utils");
|
|
25
|
+
const readCsvDefaultOptions = {
|
|
26
|
+
inferSchemaLength: 100,
|
|
27
|
+
batchSize: 8192,
|
|
28
|
+
hasHeader: true,
|
|
29
|
+
ignoreErrors: true,
|
|
30
|
+
chunkSize: 10000,
|
|
31
|
+
skipRows: 0,
|
|
32
|
+
sep: ",",
|
|
33
|
+
quoteChar: '"',
|
|
34
|
+
rechunk: false,
|
|
35
|
+
encoding: "utf8",
|
|
36
|
+
lowMemory: false,
|
|
37
|
+
tryParseDates: false,
|
|
38
|
+
skipRowsAfterHeader: 0,
|
|
39
|
+
raiseIfEmpty: true,
|
|
40
|
+
truncateRaggedLines: true,
|
|
41
|
+
missingIsNull: true,
|
|
42
|
+
eolChar: "\n",
|
|
43
|
+
};
|
|
44
|
+
const readJsonDefaultOptions = {
|
|
45
|
+
batchSize: 10000,
|
|
46
|
+
inferSchemaLength: 50,
|
|
47
|
+
format: "json",
|
|
48
|
+
};
|
|
49
|
+
// utility to read streams as lines.
|
|
50
|
+
class LineBatcher extends node_stream_1.Stream.Transform {
|
|
51
|
+
#lines;
|
|
52
|
+
#accumulatedLines;
|
|
53
|
+
#batchSize;
|
|
54
|
+
constructor(options) {
|
|
55
|
+
super(options);
|
|
56
|
+
this.#lines = [];
|
|
57
|
+
this.#accumulatedLines = 0;
|
|
58
|
+
this.#batchSize = options.batchSize;
|
|
59
|
+
}
|
|
60
|
+
_transform(chunk, _encoding, done) {
|
|
61
|
+
let begin = 0;
|
|
62
|
+
let i = 0;
|
|
63
|
+
while (i < chunk.length) {
|
|
64
|
+
if (chunk[i] === 10) {
|
|
65
|
+
// '\n'
|
|
66
|
+
this.#accumulatedLines++;
|
|
67
|
+
if (this.#accumulatedLines === this.#batchSize) {
|
|
68
|
+
this.#lines.push(chunk.subarray(begin, i + 1));
|
|
69
|
+
this.push(Buffer.concat(this.#lines));
|
|
70
|
+
this.#lines = [];
|
|
71
|
+
this.#accumulatedLines = 0;
|
|
72
|
+
begin = i + 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
i++;
|
|
76
|
+
}
|
|
77
|
+
this.#lines.push(chunk.subarray(begin));
|
|
78
|
+
done();
|
|
79
|
+
}
|
|
80
|
+
_flush(done) {
|
|
81
|
+
this.push(Buffer.concat(this.#lines));
|
|
82
|
+
done();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// helper functions
|
|
86
|
+
function readCSVBuffer(buff, options) {
|
|
87
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readCsv(buff, { ...readCsvDefaultOptions, ...options }));
|
|
88
|
+
}
|
|
89
|
+
function readRecords(records, options) {
|
|
90
|
+
if (options?.schema) {
|
|
91
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.fromRows(records, options.schema));
|
|
92
|
+
}
|
|
93
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.fromRows(records, undefined, options?.inferSchemaLength));
|
|
94
|
+
}
|
|
95
|
+
function readCSV(pathOrBody, options) {
|
|
96
|
+
options = { ...readCsvDefaultOptions, ...options };
|
|
97
|
+
const extensions = [".tsv", ".csv"];
|
|
98
|
+
// Handle If set to `null` case
|
|
99
|
+
options.inferSchemaLength = options.inferSchemaLength ?? 0;
|
|
100
|
+
if (Buffer.isBuffer(pathOrBody)) {
|
|
101
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readCsv(pathOrBody, options));
|
|
102
|
+
}
|
|
103
|
+
if (typeof pathOrBody === "string") {
|
|
104
|
+
const inline = !(0, utils_1.isPath)(pathOrBody, extensions);
|
|
105
|
+
if (inline) {
|
|
106
|
+
const buf = Buffer.from(pathOrBody, "utf-8");
|
|
107
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readCsv(buf, options));
|
|
108
|
+
}
|
|
109
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readCsv(pathOrBody, options));
|
|
110
|
+
}
|
|
111
|
+
throw new Error("must supply either a path or body");
|
|
112
|
+
}
|
|
113
|
+
const scanCsvDefaultOptions = {
|
|
114
|
+
inferSchemaLength: 100,
|
|
115
|
+
cache: true,
|
|
116
|
+
hasHeader: true,
|
|
117
|
+
ignoreErrors: true,
|
|
118
|
+
skipRows: 0,
|
|
119
|
+
sep: ",",
|
|
120
|
+
quoteChar: '"',
|
|
121
|
+
eolChar: "\n",
|
|
122
|
+
rechunk: false,
|
|
123
|
+
encoding: "utf8",
|
|
124
|
+
lowMemory: false,
|
|
125
|
+
parseDates: false,
|
|
126
|
+
skipRowsAfterHeader: 0,
|
|
127
|
+
};
|
|
128
|
+
function scanCSV(path, options) {
|
|
129
|
+
options = { ...scanCsvDefaultOptions, ...options };
|
|
130
|
+
// Handle If set to `null` case
|
|
131
|
+
options.inferSchemaLength = options.inferSchemaLength ?? 0;
|
|
132
|
+
return (0, dataframe_2._LazyDataFrame)(polars_internal_1.default.scanCsv(path, options));
|
|
133
|
+
}
|
|
134
|
+
function readJSON(pathOrBody, options = readJsonDefaultOptions) {
|
|
135
|
+
options = { ...readJsonDefaultOptions, ...options };
|
|
136
|
+
const method = options.format === "lines" ? polars_internal_1.default.readJsonLines : polars_internal_1.default.readJson;
|
|
137
|
+
const extensions = [".ndjson", ".json", ".jsonl"];
|
|
138
|
+
// Handle If set to `null` case
|
|
139
|
+
options.inferSchemaLength = options.inferSchemaLength ?? 0;
|
|
140
|
+
if (Buffer.isBuffer(pathOrBody)) {
|
|
141
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readJson(pathOrBody, options));
|
|
142
|
+
}
|
|
143
|
+
if (typeof pathOrBody === "string") {
|
|
144
|
+
const inline = !(0, utils_1.isPath)(pathOrBody, extensions);
|
|
145
|
+
if (inline) {
|
|
146
|
+
return (0, dataframe_1._DataFrame)(method(Buffer.from(pathOrBody, "utf-8"), options));
|
|
147
|
+
}
|
|
148
|
+
return (0, dataframe_1._DataFrame)(method(pathOrBody, options));
|
|
149
|
+
}
|
|
150
|
+
throw new Error("must supply either a path or body");
|
|
151
|
+
}
|
|
152
|
+
function scanJson(path, options) {
|
|
153
|
+
options = { ...readJsonDefaultOptions, ...options };
|
|
154
|
+
// Handle If set to `null` case
|
|
155
|
+
options.inferSchemaLength = options.inferSchemaLength ?? 0;
|
|
156
|
+
return (0, dataframe_2._LazyDataFrame)(polars_internal_1.default.scanJson(path, options));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Read into a DataFrame from a parquet file.
|
|
160
|
+
* @param pathOrBody
|
|
161
|
+
* Path to a file, list of files, or a file like object. If the path is a directory, that directory will be used
|
|
162
|
+
* as partition aware scan.
|
|
163
|
+
* @param options.columns Columns to select. Accepts a list of column indices (starting at zero) or a list of column names.
|
|
164
|
+
* @param options.numRows Stop reading from parquet file after reading ``numRows``.
|
|
165
|
+
* @param options.parallel
|
|
166
|
+
* Any of 'auto' | 'columns' | 'row_groups' | 'none'
|
|
167
|
+
This determines the direction of parallelism. 'auto' will try to determine the optimal direction.
|
|
168
|
+
Defaults to 'auto'
|
|
169
|
+
* @param options.rowCount Add row count as column
|
|
170
|
+
*/
|
|
171
|
+
function readParquet(pathOrBody, options) {
|
|
172
|
+
const pliOptions = {};
|
|
173
|
+
if (typeof options?.columns?.[0] === "number") {
|
|
174
|
+
pliOptions.projection = options?.columns;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
pliOptions.columns = options?.columns;
|
|
178
|
+
}
|
|
179
|
+
pliOptions.nRows = options?.numRows;
|
|
180
|
+
pliOptions.rowCount = options?.rowCount;
|
|
181
|
+
const parallel = options?.parallel ?? "auto";
|
|
182
|
+
if (Buffer.isBuffer(pathOrBody)) {
|
|
183
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readParquet(pathOrBody, pliOptions, parallel));
|
|
184
|
+
}
|
|
185
|
+
if (typeof pathOrBody === "string") {
|
|
186
|
+
const inline = !(0, utils_1.isPath)(pathOrBody, [".parquet"]);
|
|
187
|
+
if (inline) {
|
|
188
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readParquet(Buffer.from(pathOrBody), pliOptions, parallel));
|
|
189
|
+
}
|
|
190
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readParquet(pathOrBody, pliOptions, parallel));
|
|
191
|
+
}
|
|
192
|
+
throw new Error("must supply either a path or body");
|
|
193
|
+
}
|
|
194
|
+
function readAvro(pathOrBody, options = {}) {
|
|
195
|
+
if (Buffer.isBuffer(pathOrBody)) {
|
|
196
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readAvro(pathOrBody, options));
|
|
197
|
+
}
|
|
198
|
+
if (typeof pathOrBody === "string") {
|
|
199
|
+
const inline = !(0, utils_1.isPath)(pathOrBody, [".avro"]);
|
|
200
|
+
if (inline) {
|
|
201
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readAvro(Buffer.from(pathOrBody), options));
|
|
202
|
+
}
|
|
203
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readAvro(pathOrBody, options));
|
|
204
|
+
}
|
|
205
|
+
throw new Error("must supply either a path or body");
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Lazily read from a local or cloud-hosted parquet file (or files).
|
|
209
|
+
|
|
210
|
+
This function allows the query optimizer to push down predicates and projections to
|
|
211
|
+
the scan level, typically increasing performance and reducing memory overhead.
|
|
212
|
+
|
|
213
|
+
* This allows the query optimizer to push down predicates and projections to the scan level,
|
|
214
|
+
* thereby potentially reducing memory overhead.
|
|
215
|
+
* @param source - Path(s) to a file. If a single path is given, it can be a globbing pattern.
|
|
216
|
+
@param options.nRows - Stop reading from parquet file after reading `n_rows`.
|
|
217
|
+
@param options.rowIndexName - If not None, this will insert a row index column with the given name into the DataFrame
|
|
218
|
+
@param options.rowIndexOffset - Offset to start the row index column (only used if the name is set)
|
|
219
|
+
@param options.parallel : {'auto', 'columns', 'row_groups', 'none'}
|
|
220
|
+
This determines the direction of parallelism. 'auto' will try to determine the optimal direction.
|
|
221
|
+
@param options.useStatistics - Use statistics in the parquet to determine if pages can be skipped from reading.
|
|
222
|
+
@param options.hivePartitioning - Infer statistics and schema from hive partitioned URL and use them to prune reads.
|
|
223
|
+
@param options.glob - Expand path given via globbing rules.
|
|
224
|
+
@param options.hiveSchema - The column names and data types of the columns by which the data is partitioned.
|
|
225
|
+
If set to `None` (default), the schema of the Hive partitions is inferred.
|
|
226
|
+
@param options.tryParseHiveDates - Whether to try parsing hive values as date/datetime types.
|
|
227
|
+
@param options.rechunk - In case of reading multiple files via a glob pattern rechunk the final DataFrame into contiguous memory chunks.
|
|
228
|
+
@param options.lowMemory - Reduce memory pressure at the expense of performance.
|
|
229
|
+
@param options.cache - Cache the result after reading.
|
|
230
|
+
@param options.cloudOptions - Options that indicate how to connect to a cloud provider.
|
|
231
|
+
If the cloud provider is not supported by Polars, the storage options are passed to `fsspec.open()`.
|
|
232
|
+
|
|
233
|
+
The cloud providers currently supported are AWS, GCP, and Azure.
|
|
234
|
+
See supported keys here:
|
|
235
|
+
|
|
236
|
+
* `aws <https://docs.rs/object_store/latest/object_store/aws/enum.AmazonS3ConfigKey.html>`_
|
|
237
|
+
* `gcp <https://docs.rs/object_store/latest/object_store/gcp/enum.GoogleConfigKey.html>`_
|
|
238
|
+
* `azure <https://docs.rs/object_store/latest/object_store/azure/enum.AzureConfigKey.html>`_
|
|
239
|
+
|
|
240
|
+
If `cloudOptions` is not provided, Polars will try to infer the information from environment variables.
|
|
241
|
+
@param options.retries - Number of retries if accessing a cloud instance fails.
|
|
242
|
+
@param options.includeFilePaths - Include the path of the source file(s) as a column with this name.
|
|
243
|
+
|
|
244
|
+
@example
|
|
245
|
+
```
|
|
246
|
+
const lazyDf = pl.scanParquet("s3://[bucket-name]/[file-key]", {
|
|
247
|
+
cloudOptions: {
|
|
248
|
+
aws_access_key_id: credentials.accessKeyId,
|
|
249
|
+
aws_secret_access_key: credentials.secretAccessKey,
|
|
250
|
+
aws_session_token: credentials.sessionToken,
|
|
251
|
+
aws_region: "us-east-1",
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
```
|
|
255
|
+
*/
|
|
256
|
+
function scanParquet(source, options = {}) {
|
|
257
|
+
const defaultOptions = { parallel: "auto" };
|
|
258
|
+
const pliOptions = { ...defaultOptions, ...options };
|
|
259
|
+
return (0, dataframe_2._LazyDataFrame)(polars_internal_1.default.scanParquet(source, pliOptions));
|
|
260
|
+
}
|
|
261
|
+
function readIPC(pathOrBody, options = {}) {
|
|
262
|
+
if (Buffer.isBuffer(pathOrBody)) {
|
|
263
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readIpc(pathOrBody, options));
|
|
264
|
+
}
|
|
265
|
+
if (typeof pathOrBody === "string") {
|
|
266
|
+
const inline = !(0, utils_1.isPath)(pathOrBody, [".ipc"]);
|
|
267
|
+
if (inline) {
|
|
268
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readIpc(Buffer.from(pathOrBody, "utf-8"), options));
|
|
269
|
+
}
|
|
270
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readIpc(pathOrBody, options));
|
|
271
|
+
}
|
|
272
|
+
throw new Error("must supply either a path or body");
|
|
273
|
+
}
|
|
274
|
+
function readIPCStream(pathOrBody, options = {}) {
|
|
275
|
+
if (Buffer.isBuffer(pathOrBody)) {
|
|
276
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readIpcStream(pathOrBody, options));
|
|
277
|
+
}
|
|
278
|
+
if (typeof pathOrBody === "string") {
|
|
279
|
+
const inline = !(0, utils_1.isPath)(pathOrBody, [".ipc"]);
|
|
280
|
+
if (inline) {
|
|
281
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readIpcStream(Buffer.from(pathOrBody, "utf-8"), options));
|
|
282
|
+
}
|
|
283
|
+
return (0, dataframe_1._DataFrame)(polars_internal_1.default.readIpcStream(pathOrBody, options));
|
|
284
|
+
}
|
|
285
|
+
throw new Error("must supply either a path or body");
|
|
286
|
+
}
|
|
287
|
+
function scanIPC(path, options = {}) {
|
|
288
|
+
return (0, dataframe_2._LazyDataFrame)(polars_internal_1.default.scanIpc(path, options));
|
|
289
|
+
}
|
|
290
|
+
function readCSVStream(stream, options) {
|
|
291
|
+
options = { ...readCsvDefaultOptions, ...options };
|
|
292
|
+
const batchSize = options?.batchSize ?? 10000;
|
|
293
|
+
let count = 0;
|
|
294
|
+
const end = options?.endRows ?? Number.POSITIVE_INFINITY;
|
|
295
|
+
return new Promise((resolve, reject) => {
|
|
296
|
+
const s = stream.pipe(new LineBatcher({ batchSize }));
|
|
297
|
+
const chunks = [];
|
|
298
|
+
s.on("data", (chunk) => {
|
|
299
|
+
// early abort if 'end rows' is specified
|
|
300
|
+
if (count <= end) {
|
|
301
|
+
chunks.push(chunk);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
s.end();
|
|
305
|
+
}
|
|
306
|
+
count += batchSize;
|
|
307
|
+
}).on("end", () => {
|
|
308
|
+
try {
|
|
309
|
+
const buff = Buffer.concat(chunks);
|
|
310
|
+
const df = readCSVBuffer(buff, options);
|
|
311
|
+
resolve(df);
|
|
312
|
+
}
|
|
313
|
+
catch (err) {
|
|
314
|
+
reject(err);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
function readJSONStream(stream, options = readJsonDefaultOptions) {
|
|
320
|
+
options = { ...readJsonDefaultOptions, ...options };
|
|
321
|
+
return new Promise((resolve, reject) => {
|
|
322
|
+
const chunks = [];
|
|
323
|
+
stream
|
|
324
|
+
.pipe(new LineBatcher({ batchSize: options.batchSize }))
|
|
325
|
+
.on("data", (chunk) => {
|
|
326
|
+
try {
|
|
327
|
+
const df = (0, dataframe_1._DataFrame)(polars_internal_1.default.readJson(chunk, options));
|
|
328
|
+
chunks.push(df);
|
|
329
|
+
}
|
|
330
|
+
catch (err) {
|
|
331
|
+
reject(err);
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
.on("end", () => {
|
|
335
|
+
try {
|
|
336
|
+
const df = (0, functions_1.concat)(chunks);
|
|
337
|
+
resolve(df);
|
|
338
|
+
}
|
|
339
|
+
catch (err) {
|
|
340
|
+
reject(err);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
}
|