22
22
class CloudPath (UPath ):
23
23
__slots__ = ()
24
24
25
- def __init__ (
26
- self , * args , protocol : str | None = None , ** storage_options : Any
27
- ) -> None :
28
- super ().__init__ (* args , protocol = protocol , ** storage_options )
29
- if not self .drive and len (self .parts ) > 1 :
30
- raise ValueError ("non key-like path provided (bucket/container missing)" )
31
-
32
25
@classmethod
33
26
def _transform_init_args (
34
27
cls ,
@@ -71,6 +64,13 @@ def relative_to(self, other, /, *_deprecated, walk_up=False):
71
64
class GCSPath (CloudPath ):
72
65
__slots__ = ()
73
66
67
+ def __init__ (
68
+ self , * args , protocol : str | None = None , ** storage_options : Any
69
+ ) -> None :
70
+ super ().__init__ (* args , protocol = protocol , ** storage_options )
71
+ if not self .drive and len (self .parts ) > 1 :
72
+ raise ValueError ("non key-like path provided (bucket/container missing)" )
73
+
74
74
def mkdir (
75
75
self , mode : int = 0o777 , parents : bool = False , exist_ok : bool = False
76
76
) -> None :
@@ -84,6 +84,20 @@ def mkdir(
84
84
class S3Path (CloudPath ):
85
85
__slots__ = ()
86
86
87
+ def __init__ (
88
+ self , * args , protocol : str | None = None , ** storage_options : Any
89
+ ) -> None :
90
+ super ().__init__ (* args , protocol = protocol , ** storage_options )
91
+ if not self .drive and len (self .parts ) > 1 :
92
+ raise ValueError ("non key-like path provided (bucket/container missing)" )
93
+
87
94
88
95
class AzurePath (CloudPath ):
89
96
__slots__ = ()
97
+
98
+ def __init__ (
99
+ self , * args , protocol : str | None = None , ** storage_options : Any
100
+ ) -> None :
101
+ super ().__init__ (* args , protocol = protocol , ** storage_options )
102
+ if not self .drive and len (self .parts ) > 1 :
103
+ raise ValueError ("non key-like path provided (bucket/container missing)" )
0 commit comments