44from typing import overload
55from typing import Any , Dict , List , Optional , Tuple , Union
66
7+ from pyspark .sql ._typing import ReadWriterOptionType
78from pyspark .sql .dataframe import DataFrame
89from pyspark .rdd import RDD
910from pyspark .sql .context import SQLContext
@@ -19,11 +20,11 @@ class DataFrameReader(OptionUtils):
1920 def format (self , source : str ) -> DataFrameReader : ...
2021 def schema (self , schema : Union [StructType , str ]) -> DataFrameReader : ...
2122 def option (self , key : str , value : Union [bool , float , int , str ]) -> DataFrameReader : ...
22- def options (self , ** options : str ) -> DataFrameReader : ...
23- def load (self , path : Optional [PathOrPaths ] = ..., format : Optional [str ] = ..., schema : Optional [StructType ] = ..., ** options : str ) -> DataFrame : ...
23+ def options (self , ** options : ReadWriterOptionType ) -> DataFrameReader : ...
24+ def load (self , path : Optional [PathOrPaths ] = ..., format : Optional [str ] = ..., schema : Optional [StructType ] = ..., ** options : ReadWriterOptionType ) -> DataFrame : ...
2425 def json (self , path : Union [str , List [str ], RDD [str ]], schema : Optional [StructType ] = ..., primitivesAsString : Optional [Union [bool , str ]] = ..., prefersDecimal : Optional [Union [bool , str ]] = ..., allowComments : Optional [Union [bool , str ]] = ..., allowUnquotedFieldNames : Optional [Union [bool , str ]] = ..., allowSingleQuotes : Optional [Union [bool , str ]] = ..., allowNumericLeadingZero : Optional [Union [bool , str ]] = ..., allowBackslashEscapingAnyCharacter : Optional [Union [bool , str ]] = ..., mode : Optional [str ] = ..., columnNameOfCorruptRecord : Optional [str ] = ..., dateFormat : Optional [str ] = ..., timestampFormat : Optional [str ] = ..., multiLine : Optional [Union [bool , str ]] = ..., allowUnquotedControlChars : Optional [Union [bool , str ]] = ..., lineSep : Optional [str ] = ..., samplingRatio : Optional [Union [float , str ]] = ..., dropFieldIfAllNull : Optional [Union [bool , str ]] = ..., encoding : Optional [str ] = ..., locale : Optional [str ] = ..., recursiveFileLookup : Optional [bool ] = ...) -> DataFrame : ...
2526 def table (self , tableName : str ) -> DataFrame : ...
26- def parquet (self , * paths : str , ** options : str ) -> DataFrame : ...
27+ def parquet (self , * paths : str , ** options : ReadWriterOptionType ) -> DataFrame : ...
2728 def text (self , paths : PathOrPaths , wholetext : bool = ..., lineSep : Optional [str ] = ..., recursiveFileLookup : Optional [bool ] = ...) -> DataFrame : ...
2829 def csv (self , path : PathOrPaths , schema : Optional [StructType ] = ..., sep : Optional [str ] = ..., encoding : Optional [str ] = ..., quote : Optional [str ] = ..., escape : Optional [str ] = ..., comment : Optional [str ] = ..., header : Optional [Union [bool , str ]] = ..., inferSchema : Optional [Union [bool , str ]] = ..., ignoreLeadingWhiteSpace : Optional [Union [bool , str ]] = ..., ignoreTrailingWhiteSpace : Optional [Union [bool , str ]] = ..., nullValue : Optional [str ] = ..., nanValue : Optional [str ] = ..., positiveInf : Optional [str ] = ..., negativeInf : Optional [str ] = ..., dateFormat : Optional [str ] = ..., timestampFormat : Optional [str ] = ..., maxColumns : Optional [int ] = ..., maxCharsPerColumn : Optional [int ] = ..., maxMalformedLogPerPartition : Optional [int ] = ..., mode : Optional [str ] = ..., columnNameOfCorruptRecord : Optional [str ] = ..., multiLine : Optional [Union [bool , str ]] = ..., charToEscapeQuoteEscaping : Optional [str ] = ..., samplingRatio : Optional [Union [float , str ]] = ..., enforceSchema : Optional [Union [bool , str ]] = ..., emptyValue : Optional [str ] = ..., locale : Optional [str ] = ..., lineSep : Optional [str ] = ...) -> DataFrame : ...
2930 def orc (self , path : PathOrPaths , mergeSchema : Optional [bool ] = ..., recursiveFileLookup : Optional [bool ] = ...) -> DataFrame : ...
@@ -38,8 +39,8 @@ class DataFrameWriter(OptionUtils):
3839 def __init__ (self , df : DataFrame ) -> None : ...
3940 def mode (self , saveMode : str ) -> DataFrameWriter : ...
4041 def format (self , source : str ) -> DataFrameWriter : ...
41- def option (self , key : str , value : Union [ bool , float , int , str ] ) -> DataFrameWriter : ...
42- def options (self , ** options : str ) -> DataFrameWriter : ...
42+ def option (self , key : str , value : ReadWriterOptionType ) -> DataFrameWriter : ...
43+ def options (self , ** options : ReadWriterOptionType ) -> DataFrameWriter : ...
4344 @overload
4445 def partitionBy (self , * cols : str ) -> DataFrameWriter : ...
4546 @overload
@@ -52,9 +53,9 @@ class DataFrameWriter(OptionUtils):
5253 def sortBy (self , col : str , * cols : str ) -> DataFrameWriter : ...
5354 @overload
5455 def sortBy (self , col : TupleOrListOfString ) -> DataFrameWriter : ...
55- def save (self , path : Optional [str ] = ..., format : Optional [str ] = ..., mode : Optional [str ] = ..., partitionBy : Optional [List [str ]] = ..., ** options : str ) -> None : ...
56+ def save (self , path : Optional [str ] = ..., format : Optional [str ] = ..., mode : Optional [str ] = ..., partitionBy : Optional [List [str ]] = ..., ** options : ReadWriterOptionType ) -> None : ...
5657 def insertInto (self , tableName : str , overwrite : Optional [bool ] = ...) -> None : ...
57- def saveAsTable (self , name : str , format : Optional [str ] = ..., mode : Optional [str ] = ..., partitionBy : Optional [List [str ]] = ..., ** options : str ) -> None : ...
58+ def saveAsTable (self , name : str , format : Optional [str ] = ..., mode : Optional [str ] = ..., partitionBy : Optional [List [str ]] = ..., ** options : ReadWriterOptionType ) -> None : ...
5859 def json (self , path : str , mode : Optional [str ] = ..., compression : Optional [str ] = ..., dateFormat : Optional [str ] = ..., timestampFormat : Optional [str ] = ..., lineSep : Optional [str ] = ..., encoding : Optional [str ] = ..., ignoreNullFields : Optional [bool ] = ...) -> None : ...
5960 def parquet (self , path : str , mode : Optional [str ] = ..., partitionBy : Optional [List [str ]] = ..., compression : Optional [str ] = ...) -> None : ...
6061 def text (self , path : str , compression : Optional [str ] = ..., lineSep : Optional [str ] = ...) -> None : ...
0 commit comments