@@ -151,12 +151,14 @@ def _write_checkpoint_to_disk(
151
151
context : DataContext , checkpoint : Dict , checkpoint_name : str
152
152
) -> str :
153
153
# TODO this should be the responsibility of the DataContext
154
- checkpoint_dir = os .path .join (
154
+ checkpoint_dir = os .path .join ( # noqa: PTH118
155
155
context .root_directory ,
156
156
DataContextConfigDefaults .CHECKPOINTS_BASE_DIRECTORY .value ,
157
157
)
158
- checkpoint_file = os .path .join (checkpoint_dir , f"{ checkpoint_name } .yml" )
159
- os .makedirs (checkpoint_dir , exist_ok = True )
158
+ checkpoint_file = os .path .join ( # noqa: PTH118
159
+ checkpoint_dir , f"{ checkpoint_name } .yml"
160
+ )
161
+ os .makedirs (checkpoint_dir , exist_ok = True ) # noqa: PTH103
160
162
with open (checkpoint_file , "w" ) as f :
161
163
yaml .dump (checkpoint , f )
162
164
return checkpoint_file
@@ -165,7 +167,8 @@ def _write_checkpoint_to_disk(
165
167
def _load_checkpoint_yml_template () -> dict :
166
168
# TODO this should be the responsibility of the DataContext
167
169
template_file = file_relative_path (
168
- __file__ , os .path .join (".." , "data_context" , "checkpoint_template.yml" )
170
+ __file__ ,
171
+ os .path .join (".." , "data_context" , "checkpoint_template.yml" ), # noqa: PTH118
169
172
)
170
173
with open (template_file ) as f :
171
174
template = yaml .load (f )
@@ -315,11 +318,11 @@ def checkpoint_script(checkpoint, directory) -> None:
315
318
_ = toolkit .load_checkpoint (context , checkpoint , usage_event )
316
319
317
320
script_name = f"run_{ checkpoint } .py"
318
- script_path = os .path .join (
321
+ script_path = os .path .join ( # noqa: PTH118
319
322
context .root_directory , context .GX_UNCOMMITTED_DIR , script_name
320
323
)
321
324
322
- if os .path .isfile (script_path ):
325
+ if os .path .isfile (script_path ): # noqa: PTH113
323
326
toolkit .exit_with_failure_message_and_stats (
324
327
context ,
325
328
usage_event ,
@@ -350,7 +353,9 @@ def _load_script_template() -> str:
350
353
def _write_checkpoint_script_to_disk (
351
354
context_directory : str , checkpoint_name : str , script_path : str
352
355
) -> None :
353
- script_full_path = os .path .abspath (os .path .join (script_path ))
356
+ script_full_path = os .path .abspath ( # noqa: PTH100
357
+ os .path .join (script_path ) # noqa: PTH118
358
+ )
354
359
template = _load_script_template ().format (checkpoint_name , context_directory )
355
360
linted_code = lint_code (template )
356
361
with open (script_full_path , "w" ) as f :
0 commit comments