@@ -31,33 +31,33 @@ describe("pipeCsvTransform", function () {
3131 // streamCsvTransformer(inputFilePath, transformer, { outputFilePath, inputStreamOptions: { header: true } })
3232 // });
3333
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
4444
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()
5050
51- }
52- return csvOutputStream
53- }
51+ // }
52+ // return csvOutputStream
53+ // }
5454
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+ // });
6363} )
0 commit comments