@@ -411,6 +411,29 @@ def parse_location(location: str) -> Tuple[str, str, str]:
411411 else :
412412 return uri .scheme , uri .netloc , f"{ uri .netloc } { uri .path } "
413413
414+ def _initialize_fs (self , scheme : str , netloc : Optional [str ] = None ) -> FileSystem :
415+ """Initialize FileSystem for different scheme."""
416+ if scheme in {"oss" }:
417+ return self ._initialize_oss_fs ()
418+
419+ elif scheme in {"s3" , "s3a" , "s3n" }:
420+ return self ._initialize_s3_fs (netloc )
421+
422+ elif scheme in {"hdfs" , "viewfs" }:
423+ return self ._initialize_hdfs_fs (scheme , netloc )
424+
425+ elif scheme in {"gs" , "gcs" }:
426+ return self ._initialize_gcs_fs ()
427+
428+ elif scheme in {"abfs" , "abfss" , "wasb" , "wasbs" }:
429+ return self ._initialize_azure_fs ()
430+
431+ elif scheme in {"file" }:
432+ return self ._initialize_local_fs ()
433+
434+ else :
435+ raise ValueError (f"Unrecognized filesystem type in URI: { scheme } " )
436+
414437 def _process_basic_properties (
415438 self , property_mapping : Dict [str , str ], special_properties : Set [str ], prefix : str
416439 ) -> Dict [str , Any ]:
@@ -437,29 +460,6 @@ def _process_basic_properties(
437460
438461 return client_kwargs
439462
440- def _initialize_fs (self , scheme : str , netloc : Optional [str ] = None ) -> FileSystem :
441- """Initialize FileSystem for different scheme."""
442- if scheme in {"oss" }:
443- return self ._initialize_oss_fs ()
444-
445- elif scheme in {"s3" , "s3a" , "s3n" }:
446- return self ._initialize_s3_fs (netloc )
447-
448- elif scheme in {"hdfs" , "viewfs" }:
449- return self ._initialize_hdfs_fs (scheme , netloc )
450-
451- elif scheme in {"gs" , "gcs" }:
452- return self ._initialize_gcs_fs ()
453-
454- elif scheme in {"abfs" , "abfss" , "wasb" , "wasbs" }:
455- return self ._initialize_azure_fs ()
456-
457- elif scheme in {"file" }:
458- return self ._initialize_local_fs ()
459-
460- else :
461- raise ValueError (f"Unrecognized filesystem type in URI: { scheme } " )
462-
463463 def _initialize_oss_fs (self ) -> FileSystem :
464464 from pyarrow .fs import S3FileSystem
465465
0 commit comments