@@ -54,6 +54,7 @@ const $readCSV = async (filePath: string, options?: CsvInputOptionsNode): Promis
5454 return new Promise ( resolve => {
5555 const optionsWithDefaults = {
5656 header : true ,
57+ dynamicTyping : true ,
5758 ...options ,
5859 }
5960
@@ -76,6 +77,7 @@ const $readCSV = async (filePath: string, options?: CsvInputOptionsNode): Promis
7677 const fileStream = fs . createReadStream ( filePath )
7778 Papa . parse ( fileStream , {
7879 header : true ,
80+ dynamicTyping : true ,
7981 ...options ,
8082 complete : results => {
8183 const df = new DataFrame ( results . data , frameConfig ) ;
@@ -107,6 +109,7 @@ const $streamCSV = async (filePath: string, callback: (df: DataFrame) => void, o
107109 if ( filePath . startsWith ( "http" ) || filePath . startsWith ( "https" ) ) {
108110 const optionsWithDefaults = {
109111 header : true ,
112+ dynamicTyping : true ,
110113 ...options ,
111114 }
112115 return new Promise ( resolve => {
@@ -132,6 +135,7 @@ const $streamCSV = async (filePath: string, callback: (df: DataFrame) => void, o
132135 let count = - 1
133136 Papa . parse ( fileStream , {
134137 header : true ,
138+ dynamicTyping : true ,
135139 ...options ,
136140 step : results => {
137141 const df = new DataFrame ( [ results . data ] , { ...frameConfig , index : [ count ++ ] } ) ;
@@ -223,7 +227,7 @@ const $openCsvInputStream = (filePath: string, options: CsvInputOptionsNode) =>
223227
224228 if ( filePath . startsWith ( "http" ) || filePath . startsWith ( "https" ) ) {
225229 const dataStream = request . get ( filePath ) ;
226- const parseStream : any = Papa . parse ( Papa . NODE_STREAM_INPUT , { header, ...options } ) ;
230+ const parseStream : any = Papa . parse ( Papa . NODE_STREAM_INPUT , { header, dynamicTyping : true , ...options } ) ;
227231 dataStream . pipe ( parseStream ) ;
228232 let count = - 1
229233
@@ -255,7 +259,7 @@ const $openCsvInputStream = (filePath: string, options: CsvInputOptionsNode) =>
255259 const fileStream = fs . createReadStream ( filePath )
256260 let count = - 1
257261 Papa . parse ( fileStream , {
258- ...{ header, ...options } ,
262+ ...{ header, dynamicTyping : true , ...options } ,
259263 step : results => {
260264 if ( isFirstChunk ) {
261265 if ( header === true ) {
0 commit comments