File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -673,15 +673,33 @@ def _validate_names(names: Sequence[Hashable] | None) -> None:
673
673
def _multi_file_generator (
674
674
list_of_files : list [FilePath ], kwds
675
675
) -> Generator [DataFrame ] | Generator [TextFileReader ]:
676
- """Generator for multiple files."""
676
+ """
677
+ Generator that yields DataFrames or TextFileReaders for each file in the
678
+ provided list of files.
679
+ Parameters
680
+ ----------
681
+ list_of_files : list of str or Path
682
+ List of file paths to read.
683
+ kwds : dict
684
+ Keyword arguments to pass to the TextFileReader.
685
+ Returns
686
+ -------
687
+ Generator[DataFrame] | Generator[TextFileReader]
688
+ A generator that yields DataFrames or TextFileReaders for each file.
689
+ """
690
+
691
+ chunksize = kwds .get ("chunksize" , None )
692
+ iterator = kwds .get ("iterator" , False )
693
+ nrows = kwds .get ("nrows" , None )
694
+
677
695
for file in list_of_files :
678
696
parser = TextFileReader (file , ** kwds )
679
697
680
- if kwds . get ( " chunksize" , None ) or kwds . get ( " iterator" , False ) :
698
+ if chunksize or iterator :
681
699
yield parser
682
700
else :
683
701
with parser :
684
- yield parser .read (kwds . get ( " nrows" , None ) )
702
+ yield parser .read (nrows )
685
703
686
704
687
705
def _read (
You can’t perform that action at this time.
0 commit comments