@@ -64,7 +64,7 @@ class PipelineWise:
6464 STATUS_FAILED = 'FAILED'
6565 TRANSFORM_FIELD_CONNECTOR_NAME = 'transform-field'
6666
67- def __init__ (self , args , config_dir , venv_dir , profiling_dir = None ):
67+ def __init__ (self , args , config_dir , venv_dir , profiling_dir = None , temp_dir = None ):
6868
6969 self .profiling_mode = args .profiler
7070 self .profiling_dir = profiling_dir
@@ -73,6 +73,9 @@ def __init__(self, args, config_dir, venv_dir, profiling_dir=None):
7373 self .logger = logging .getLogger (__name__ )
7474 self .config_dir = config_dir
7575 self .venv_dir = venv_dir
76+ self .temp_dir = temp_dir
77+ if self .temp_dir is None :
78+ self .temp_dir = os .path .join (self .config_dir , 'tmp' )
7679 self .extra_log = args .extra_log
7780 self .pipelinewise_bin = os .path .join (
7881 self .venv_dir , 'cli' , 'bin' , 'pipelinewise'
@@ -141,7 +144,7 @@ def create_consumable_target_config(self, target_config, tap_inheritable_config)
141144
142145 # Save the new dict as JSON into a temp file
143146 tempfile_path = utils .create_temp_file (
144- dir = self .get_temp_dir () , prefix = 'target_config_' , suffix = '.json'
147+ dir = self .temp_dir , prefix = 'target_config_' , suffix = '.json'
145148 )[1 ]
146149 utils .save_json (dict_a , tempfile_path )
147150
@@ -324,12 +327,12 @@ def create_filtered_tap_properties(
324327 if create_fallback :
325328 # Save to files: filtered and fallback properties
326329 temp_properties_path = utils .create_temp_file (
327- dir = self .get_temp_dir () , prefix = 'properties_' , suffix = '.json'
330+ dir = self .temp_dir , prefix = 'properties_' , suffix = '.json'
328331 )[1 ]
329332 utils .save_json (properties , temp_properties_path )
330333
331334 temp_fallback_properties_path = utils .create_temp_file (
332- dir = self .get_temp_dir () , prefix = 'properties_' , suffix = '.json'
335+ dir = self .temp_dir , prefix = 'properties_' , suffix = '.json'
333336 )[1 ]
334337 utils .save_json (fallback_properties , temp_fallback_properties_path )
335338
@@ -342,7 +345,7 @@ def create_filtered_tap_properties(
342345
343346 # Fallback not required: Save only the filtered properties JSON
344347 temp_properties_path = utils .create_temp_file (
345- dir = self .get_temp_dir () , prefix = 'properties_' , suffix = '.json'
348+ dir = self .temp_dir , prefix = 'properties_' , suffix = '.json'
346349 )[1 ]
347350 utils .save_json (properties , temp_properties_path )
348351
@@ -363,12 +366,6 @@ def load_config(self):
363366 else :
364367 self .config = {}
365368
366- def get_temp_dir (self ):
367- """
368- Returns the tap specific temp directory
369- """
370- return os .path .join (self .config_dir , 'tmp' )
371-
372369 def get_tap_dir (self , target_id , tap_id ):
373370 """
374371 Get absolute path of a tap directory
@@ -1083,7 +1080,7 @@ def run_tap_fastsync(
10831080 target = target ,
10841081 transform = transform ,
10851082 venv_dir = self .venv_dir ,
1086- temp_dir = self .get_temp_dir () ,
1083+ temp_dir = self .temp_dir ,
10871084 tables = self .args .tables ,
10881085 profiling_mode = self .profiling_mode ,
10891086 profiling_dir = self .profiling_dir ,
@@ -1565,7 +1562,9 @@ def import_project(self):
15651562 """
15661563 # Read the YAML config files and transform/save into singer compatible
15671564 # JSON files in a common directory structure
1568- config = Config .from_yamls (self .config_dir , self .args .dir , self .args .secret )
1565+ config = Config .from_yamls (
1566+ self .config_dir , self .args .dir , self .args .secret , self .temp_dir
1567+ )
15691568 config .save ()
15701569
15711570 # Activating tap stream selections
@@ -1801,7 +1800,7 @@ def __validate_transformations(
18011800 # create a temp file with the content being the given catalog object
18021801 # we need this file to execute the validation cli command
18031802 temp_catalog_file = utils .create_temp_file (
1804- dir = self .get_temp_dir () , prefix = 'properties_' , suffix = '.json'
1803+ dir = self .temp_dir , prefix = 'properties_' , suffix = '.json'
18051804 )[1 ]
18061805
18071806 utils .save_json (catalog , temp_catalog_file )
0 commit comments