def __init__( self, filepath_or_buffer, orient, typ, dtype, convert_axes, convert_dates, keep_default_dates: bool, numpy: bool, precise_float: bool, date_unit, encoding, lines: bool, chunksize: Optional[int], compression: CompressionOptions, nrows: Optional[int], ): compression_method, compression = get_compression_method(compression) compression = dict(compression, method=compression_method) self.orient = orient self.typ = typ self.dtype = dtype self.convert_axes = convert_axes self.convert_dates = convert_dates self.keep_default_dates = keep_default_dates self.numpy = numpy self.precise_float = precise_float self.date_unit = date_unit self.encoding = encoding self.compression = compression self.lines = lines self.chunksize = chunksize self.nrows_seen = 0 self.should_close = False self.nrows = nrows self.file_handles: List[IO] = [] if self.chunksize is not None: self.chunksize = validate_integer("chunksize", self.chunksize, 1) if not self.lines: raise ValueError("chunksize can only be passed if lines=True") if self.nrows is not None: self.nrows = validate_integer("nrows", self.nrows, 0) if not self.lines: raise ValueError("nrows can only be passed if lines=True") data = self._get_data_from_filepath(filepath_or_buffer) self.data = self._preprocess_data(data)
def __init__( self, filepath_or_buffer, orient, typ, dtype, convert_axes, convert_dates, keep_default_dates: bool, numpy: bool, precise_float: bool, date_unit, encoding, lines: bool, chunksize: Optional[int], compression: CompressionOptions, nrows: Optional[int], storage_options: StorageOptions = None, ): self.orient = orient self.typ = typ self.dtype = dtype self.convert_axes = convert_axes self.convert_dates = convert_dates self.keep_default_dates = keep_default_dates self.numpy = numpy self.precise_float = precise_float self.date_unit = date_unit self.encoding = encoding self.compression = compression self.storage_options = storage_options self.lines = lines self.chunksize = chunksize self.nrows_seen = 0 self.nrows = nrows self.handles: Optional[IOHandles] = None if self.chunksize is not None: self.chunksize = validate_integer("chunksize", self.chunksize, 1) if not self.lines: raise ValueError("chunksize can only be passed if lines=True") if self.nrows is not None: self.nrows = validate_integer("nrows", self.nrows, 0) if not self.lines: raise ValueError("nrows can only be passed if lines=True") data = self._get_data_from_filepath(filepath_or_buffer) self.data = self._preprocess_data(data)