initialise settings
@@ -67,8 +67,8 @@ class SplinkDataFrame:
class Linker:
def __init__(self, settings_dict=None, input_tables={}):
- self.settings = settings_dict
self.pipeline = SQLPipeline()
+ self.initialise_settings(settings_dict)
self.input_dfs = self._get_input_dataframe_dict(input_tables)
@@ -84,16 +84,22 @@ class Linker:
self.debug_mode = False
@property
- def settings(self):
- return self.settings_obj
+ def settings_obj(self):
+ if self._settings_obj is None:
+ raise ValueError(
+ "You did not provide a settings dictionary when you "
+ "created the linker. To continue, you need to provide a settings "
+ "dictionary using the `initialise_settings()` method on your linker "
+ "object. i.e. linker.initialise_settings(settings_dict)"
+ )
+ return self._settings_obj
- @settings.setter
- def settings(self, settings_dict):
+ def initialise_settings(self, settings_dict):
self.settings_dict = settings_dict
if settings_dict is None:
- self.settings_obj = None
+ self._settings_obj = None
else:
- self.settings_obj = Settings(settings_dict)
+ self._settings_obj = Settings(settings_dict)
@property
def _input_tablename_l(self):
@@ -287,7 +293,7 @@ class Linker:
new_linker = copy(self)
new_linker.em_training_sessions = []
new_settings = deepcopy(self.settings_obj)
- new_linker.settings_obj = new_settings
+ new_linker._settings_obj = new_settings
return new_linker
def _get_input_dataframe_dict(self, df_dict):
