2222class CloudPath (UPath ):
2323 __slots__ = ()
2424
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-
3225 @classmethod
3326 def _transform_init_args (
3427 cls ,
@@ -71,6 +64,13 @@ def relative_to(self, other, /, *_deprecated, walk_up=False):
7164class GCSPath (CloudPath ):
7265 __slots__ = ()
7366
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+
7474 def mkdir (
7575 self , mode : int = 0o777 , parents : bool = False , exist_ok : bool = False
7676 ) -> None :
@@ -84,6 +84,20 @@ def mkdir(
8484class S3Path (CloudPath ):
8585 __slots__ = ()
8686
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+
8794
8895class AzurePath (CloudPath ):
8996 __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