4
4
from typing import overload
5
5
from typing import Any , Dict , List , Optional , Tuple , Union
6
6
7
+ from pyspark .sql ._typing import ReadWriterOptionType
7
8
from pyspark .sql .dataframe import DataFrame
8
9
from pyspark .rdd import RDD
9
10
from pyspark .sql .context import SQLContext
@@ -19,11 +20,11 @@ class DataFrameReader(OptionUtils):
19
20
def format (self , source : str ) -> DataFrameReader : ...
20
21
def schema (self , schema : Union [StructType , str ]) -> DataFrameReader : ...
21
22
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 : ...
24
25
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 : ...
25
26
def table (self , tableName : str ) -> DataFrame : ...
26
- def parquet (self , * paths : str , ** options : str ) -> DataFrame : ...
27
+ def parquet (self , * paths : str , ** options : ReadWriterOptionType ) -> DataFrame : ...
27
28
def text (self , paths : PathOrPaths , wholetext : bool = ..., lineSep : Optional [str ] = ..., recursiveFileLookup : Optional [bool ] = ...) -> DataFrame : ...
28
29
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 : ...
29
30
def orc (self , path : PathOrPaths , mergeSchema : Optional [bool ] = ..., recursiveFileLookup : Optional [bool ] = ...) -> DataFrame : ...
@@ -38,8 +39,8 @@ class DataFrameWriter(OptionUtils):
38
39
def __init__ (self , df : DataFrame ) -> None : ...
39
40
def mode (self , saveMode : str ) -> DataFrameWriter : ...
40
41
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 : ...
43
44
@overload
44
45
def partitionBy (self , * cols : str ) -> DataFrameWriter : ...
45
46
@overload
@@ -52,9 +53,9 @@ class DataFrameWriter(OptionUtils):
52
53
def sortBy (self , col : str , * cols : str ) -> DataFrameWriter : ...
53
54
@overload
54
55
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 : ...
56
57
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 : ...
58
59
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 : ...
59
60
def parquet (self , path : str , mode : Optional [str ] = ..., partitionBy : Optional [List [str ]] = ..., compression : Optional [str ] = ...) -> None : ...
60
61
def text (self , path : str , compression : Optional [str ] = ..., lineSep : Optional [str ] = ...) -> None : ...
0 commit comments