@@ -28,7 +28,7 @@ def exists(uri):
28
28
)
29
29
except Exception as e :
30
30
raise RuntimeError (
31
- f"Cannot check existence of hdfs uri[{ uri } ] " f" with cmd[{ cmd } ]"
31
+ f"Cannot check existence of hdfs uri[{ uri } ] with cmd[{ cmd } ]"
32
32
) from e
33
33
34
34
@staticmethod
@@ -48,9 +48,7 @@ def remove(uri):
48
48
f"with cmd[{ cmd } ]; ret[{ ret } ] output[{ out } ] stderr[{ err } ]"
49
49
)
50
50
except Exception as e :
51
- raise RuntimeError (
52
- f"Cannot remove hdfs uri[{ uri } ] " f"with cmd[{ cmd } ]"
53
- ) from e
51
+ raise RuntimeError (f"Cannot remove hdfs uri[{ uri } ] with cmd[{ cmd } ]" ) from e
54
52
55
53
@staticmethod
56
54
def mkdir (uri ):
@@ -70,7 +68,7 @@ def mkdir(uri):
70
68
)
71
69
except Exception as e :
72
70
raise RuntimeError (
73
- f"Cannot mkdir of hdfs uri[{ uri } ] " f" with cmd[{ cmd } ]"
71
+ f"Cannot mkdir of hdfs uri[{ uri } ] with cmd[{ cmd } ]"
74
72
) from e
75
73
76
74
@staticmethod
@@ -80,7 +78,7 @@ def copy_from_local(local_path, to_uri):
80
78
"""
81
79
# Make sure local_path is accessible
82
80
if not os .path .exists (local_path ) or not os .access (local_path , os .R_OK ):
83
- raise RuntimeError (f"try to access local_path[{ local_path } ] " " but failed" )
81
+ raise RuntimeError (f"try to access local_path[{ local_path } ] but failed" )
84
82
cmd = f"hadoop fs -copyFromLocal -f { local_path } { to_uri } "
85
83
try :
86
84
ret , out , err = run_cmd_with_all_output (cmd )
@@ -132,9 +130,7 @@ def read_hdfs_file(uri):
132
130
f"cmd [{ cmd } ] ret[{ ret } ] output[{ out } ] stderr[{ err } ]"
133
131
)
134
132
except Exception as e :
135
- raise RuntimeError (
136
- f"Cannot read text from uri[{ uri } ]" f"cmd [{ cmd } ]"
137
- ) from e
133
+ raise RuntimeError (f"Cannot read text from uri[{ uri } ]cmd [{ cmd } ]" ) from e
138
134
139
135
@staticmethod
140
136
def move (from_uri , to_uri ):
@@ -151,6 +147,5 @@ def move(from_uri, to_uri):
151
147
)
152
148
except Exception as e :
153
149
raise RuntimeError (
154
- f"Cannot move from_uri[{ from_uri } ] to "
155
- f"to_uri[{ to_uri } ] with cmd[{ cmd } ]"
150
+ f"Cannot move from_uri[{ from_uri } ] to to_uri[{ to_uri } ] with cmd[{ cmd } ]"
156
151
) from e
0 commit comments