diff --git a/src/subscript/merge_rft_ertobs/merge_rft_ertobs.py b/src/subscript/merge_rft_ertobs/merge_rft_ertobs.py index 078d07aa2..f391d8cc8 100644 --- a/src/subscript/merge_rft_ertobs/merge_rft_ertobs.py +++ b/src/subscript/merge_rft_ertobs/merge_rft_ertobs.py @@ -223,8 +223,11 @@ def merge_rft_ertobs(gendatacsv: str, obsdir: str) -> pd.DataFrame: # For each simulated well, look up logger.info("Parsed %s observations from files in %s", str(len(obs_df)), obsdir) - - return pd.merge(sim_df, obs_df, how="left", on=["well", "order", "report_step"]) + if "report_step" in sim_df.columns: + return pd.merge(sim_df, obs_df, how="left", on=["well", "order", "report_step"]) + else: + # Ensure backward compatibility where gendata_rft + return pd.merge(sim_df, obs_df, how="left", on=["well", "order"]) def main() -> None: