diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8b1c341..461943e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ on: - '**' # Triggers on pull requests to any branch jobs: - test: + build: runs-on: ubuntu-latest steps: diff --git a/experiment_utils/experiment_analyzer.py b/experiment_utils/experiment_analyzer.py index 3fb6090..e9a4d12 100644 --- a/experiment_utils/experiment_analyzer.py +++ b/experiment_utils/experiment_analyzer.py @@ -34,12 +34,12 @@ def __init__( assess_overlap = False): """ - Initialize an ExperimentAnalyzer object + Initialize ExperimentAnalyzer Parameters ---------- data : DataFrame - Dataframe containing the data + PySpark Dataframe outcomes : List List of outcome variables covariates : List diff --git a/tests/test_experiment_analyzer.py b/tests/test_experiment_analyzer.py index 49b9404..72c31ed 100644 --- a/tests/test_experiment_analyzer.py +++ b/tests/test_experiment_analyzer.py @@ -89,8 +89,6 @@ def test_no_covariates(sample_data): treatment_col=treatment_col, experiment_identifier=experiment_identifier) - - # This should not raise an error since all columns are present try: analyzer.get_effects() analyzer.results @@ -114,7 +112,30 @@ def test_no_adjustment(sample_data): covariates=covariates ) - # This should not raise an error since all columns are present + try: + analyzer.get_effects() + analyzer.results + assert True + except Exception as e: + pytest.fail(f" raised an exception: {e}") + + +def test_ipw_adjustment(sample_data): + """Test get_effects no adjustments""" + outcomes = "conversion" + treatment_col = "treatment" + experiment_identifier = "experiment" + covariates = "baseline_conversion" + + analyzer = ExperimentAnalyzer( + data=sample_data, + outcomes=outcomes, + treatment_col=treatment_col, + experiment_identifier=experiment_identifier, + covariates=covariates, + adjustment="IPW" + ) + try: analyzer.get_effects() analyzer.results