Exemple #1
0
 def __init__(self,
              name,
              source=None,
              destination=None,
              custom_workflow_param=None):
     self.custom_workflow_param = custom_workflow_param
     Workflow.__init__(self, name, source, destination)
Exemple #2
0
 def __init__(
     self,
     name,
     source=None,
     destination=None,
     interval="day",
     threshold=2.5,
     window=7,
     raw_data_col_name="_raw",
 ):
     self.interval = interval
     self._threshold = threshold
     self._window = window
     self._snp = SplunkNotableParser()
     self._raw_data_col_name = raw_data_col_name
     Workflow.__init__(self, name, source, destination)
Exemple #3
0
def test_benchmark_decorator(tmpdir, mock_env_home, set_workflow_config):
    # Dummy function
    def func(self):
        return DataFrame()

    benchmarked_func = Workflow.benchmark(func)

    source = set_workflow_config[1]
    destination = set_workflow_config[2]

    test_dir = tmpdir.mkdir("tmp_test_workflow")
    input_path = str(test_dir.join("person.csv"))
    input_df.to_csv(input_path, index=False)
    output_path = str(test_dir.join("output_benchmark.csv"))
    source["input_path"] = input_path
    destination["output_path"] = output_path
    # Create new workflow with source and destination configurations
    tb = spy(
        TestWorkflowImpl(source=source,
                         destination=destination,
                         name="test-workflow"))
    benchmarked_func(tb.run_workflow)

    # Verify that run_workflow was not called, instead expect that benchmark wrapper function will be called
    verify(tb, times=0).run_workflow(...)
Exemple #4
0
def test_benchmark_decorator(
    mock_env_home, set_workflow_config, input_path, output_path
):
    # Dummy function
    def func(self):
        return DataFrame()

    benchmarked_func = Workflow.benchmark(func)

    source = set_workflow_config[1]
    destination = set_workflow_config[2]
    source["input_path"] = input_path
    destination["output_path"] = output_path
    # Create new workflow with source and destination configurations
    tb = spy(
        TestWorkflowImpl(source=source, destination=destination, name="test-workflow")
    )
    benchmarked_func(tb.run_workflow)

    # Verify that run_workflow was not called, instead expect that benchmark wrapper function will be called
    verify(tb, times=0).run_workflow(...)