Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions jetstream/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ def _create_subset_metric_table_query_covariate(
)

if not self.bigquery.column_exists_in_table(covariate_table_name, covariate_metric_name):
normalized_slug = bq_normalize_name(self.config.experiment.normandy_slug)
log_msg = (
f"Covariate adjustment table {covariate_table_name} does not exist "
f"(or `{covariate_metric_name}` not found in table), "
Expand All @@ -895,7 +894,7 @@ def _create_subset_metric_table_query_covariate(
logger.warning(
log_msg,
extra={
"experiment": normalized_slug,
"experiment": self.config.experiment.normandy_slug,
"metric": metric.name,
"analysis_basis": analysis_basis.value,
"segment": segment,
Expand Down
26 changes: 24 additions & 2 deletions jetstream/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,23 @@ def execute(
else:
dataset_id = self.dataset_id

# `do_rerun`` experiment should only run OVERALL
analysis_periods = self.analysis_periods
if config.experiment.do_rerun:
analysis_periods = [AnalysisPeriod.OVERALL]
logger.warning(
"`do_rerun` experiment: skipping non-overall periods.",
extra={"experiment": config.experiment.normandy_slug},
)

# run the analysis
analysis = self.analysis_class(
self.project_id,
dataset_id,
config,
self.log_config,
None,
self.analysis_periods,
analysis_periods,
self.sql_output_dir,
)
analysis.run(
Expand Down Expand Up @@ -483,7 +492,7 @@ def _experiment_configs_to_analyse(
for e in experiments.ended_after_or_live(ended_threshold)
.of_type(RECOGNIZED_EXPERIMENT_TYPES)
.experiments
if not e.is_rollout
if not e.is_rollout and not e.do_rerun
]

launched_configs = self._experiments_to_configs(launched_experiments, config_getter)
Expand Down Expand Up @@ -1317,6 +1326,19 @@ def rerun_config_changed(
experiments_with_updated_defaults + [conf.slug for conf in updated_configs]
)

# get the experiments from Experimenter API that are explicitly marked for rerun
# and are out of date
all_experiments = ExperimentCollection.from_experimenter()
rerun_experiments = [exp for exp in all_experiments if exp.do_rerun]
client = BigQueryClient(project_id, dataset_id)
for exp in rerun_experiments:
first_updated = client.experiment_table_first_updated(exp.normandy_slug)
# if exp was never run (has no results tables) or was last run before new rerun trigger
if first_updated is None or (
exp.do_rerun_timestamp is not None and first_updated < exp.do_rerun_timestamp
):
experiment_slugs.add(exp.normandy_slug)

# update the table timestamps which indicate whether a experiment needs to be rerun
client = BigQueryClient(project_id, dataset_id)
for slug in experiment_slugs:
Expand Down
Loading