@@ -31,33 +31,33 @@ describe("pipeCsvTransform", function () {
31
31
// streamCsvTransformer(inputFilePath, transformer, { outputFilePath, inputStreamOptions: { header: true } })
32
32
// });
33
33
34
- it ( "streamCsvTransformer works for custom writers" , async function ( ) {
35
- const inputFilePath = "https://raw.githubusercontent.com/opensource9ja/danfojs/dev/danfojs-node/tests/samples/titanic.csv"
36
- const transformer = ( df : DataFrame ) => {
37
- const titles = df [ "Name" ] . map ( ( name : string ) => name . split ( "." ) [ 0 ] ) ;
38
- const names = df [ "Name" ] . map ( ( name : string ) => name . split ( "." ) [ 1 ] ) ;
39
- df [ "Name" ] = names
40
- df . addColumn ( "titles" , titles , { inplace : true } )
41
- return df
42
- }
43
- let count = 0
34
+ // it("streamCsvTransformer works for custom writers", async function () {
35
+ // const inputFilePath = "https://raw.githubusercontent.com/opensource9ja/danfojs/dev/danfojs-node/tests/samples/titanic.csv"
36
+ // const transformer = (df: DataFrame) => {
37
+ // const titles = df["Name"].map((name: string) => name.split(".")[0]);
38
+ // const names = df["Name"].map((name: string) => name.split(".")[1]);
39
+ // df["Name"] = names
40
+ // df.addColumn("titles", titles, { inplace: true })
41
+ // return df
42
+ // }
43
+ // let count = 0
44
44
45
- const customWriter = function ( ) {
46
- const csvOutputStream = new stream . Writable ( { objectMode : true } )
47
- csvOutputStream . _write = ( chunk : DataFrame | Series , encoding , callback ) => {
48
- count += 1
49
- callback ( )
45
+ // const customWriter = function () {
46
+ // const csvOutputStream = new stream.Writable({ objectMode: true })
47
+ // csvOutputStream._write = (chunk: DataFrame | Series, encoding, callback) => {
48
+ // count += 1
49
+ // callback()
50
50
51
- }
52
- return csvOutputStream
53
- }
51
+ // }
52
+ // return csvOutputStream
53
+ // }
54
54
55
- streamCsvTransformer (
56
- inputFilePath ,
57
- transformer ,
58
- {
59
- customCSVStreamWriter : customWriter ,
60
- inputStreamOptions : { header : true }
61
- } )
62
- } ) ;
55
+ // streamCsvTransformer(
56
+ // inputFilePath,
57
+ // transformer,
58
+ // {
59
+ // customCSVStreamWriter: customWriter,
60
+ // inputStreamOptions: { header: true }
61
+ // })
62
+ // });
63
63
} )
0 commit comments