File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ def schema(self, schema):
7373 self ._jreader = self ._jreader .schema (jschema )
7474 return self
7575
76+ @since (1.4 )
77+ def option (self , key , value ):
78+ """Adds an input option for the underlying data source.
79+ """
80+ self ._jreader = self ._jreader .option (key , value )
81+ return self
82+
7683 @since (1.4 )
7784 def options (self , ** options ):
7885 """Adds input options for the underlying data source.
@@ -235,6 +242,13 @@ def format(self, source):
235242 self ._jwrite = self ._jwrite .format (source )
236243 return self
237244
245+ @since (1.4 )
246+ def option (self , key , value ):
247+ """Adds an output option for the underlying data source.
248+ """
249+ self ._jwrite = self ._jwrite .option (key , value )
250+ return self
251+
238252 @since (1.4 )
239253 def options (self , ** options ):
240254 """Adds output options for the underlying data source.
Original file line number Diff line number Diff line change @@ -564,6 +564,7 @@ def test_save_and_load_builder(self):
564564 self .assertEqual (sorted (df .collect ()), sorted (actual .collect ()))
565565
566566 df .write .mode ("overwrite" ).options (noUse = "this options will not be used in save." )\
567+ .option ("noUse" , "this option will not be used in save." )\
567568 .format ("json" ).save (path = tmpPath )
568569 actual = \
569570 self .sqlCtx .read .format ("json" )\
You can’t perform that action at this time.
0 commit comments