File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 4
4
import posixpath
5
5
import re
6
6
import tempfile
7
+ import warnings
7
8
from fsspec import AbstractFileSystem
8
9
from fsspec .utils import stringify_path
9
10
@@ -21,8 +22,16 @@ class LocalFileSystem(AbstractFileSystem):
21
22
22
23
root_marker = "/"
23
24
24
- def __init__ (self , auto_mkdir = True , ** kwargs ):
25
+ def __init__ (self , auto_mkdir = None , ** kwargs ):
25
26
super ().__init__ (** kwargs )
27
+ if auto_mkdir is None :
28
+ warnings .warn (
29
+ "The default value of auto_mkdir=True has been deprecated "
30
+ "and will be changed to auto_mkdir=False by default in a "
31
+ "future release." ,
32
+ FutureWarning ,
33
+ )
34
+ auto_mkdir = True
26
35
self .auto_mkdir = auto_mkdir
27
36
28
37
def mkdir (self , path , create_parents = True , ** kwargs ):
Original file line number Diff line number Diff line change @@ -432,3 +432,10 @@ def test_links(tmpdir):
432
432
def test_isfilestore ():
433
433
fs = LocalFileSystem (auto_mkdir = False )
434
434
assert fs ._isfilestore ()
435
+
436
+
437
+ def test_auto_mkdir_warns ():
438
+ # Ensure we're not pulling from instance cache
439
+ LocalFileSystem .clear_instance_cache ()
440
+ with pytest .warns (FutureWarning , match = "auto_mkdir=True has been deprecated" ):
441
+ LocalFileSystem ()
You can’t perform that action at this time.
0 commit comments