Skip to content

Commit 6466c34

Browse files
committed
revert unwanted changes
1 parent 71ef1dc commit 6466c34

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

genie/process_functions.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ def _create_update_rowsdf(
579579
logger.info("Updating rows")
580580
toupdatedf.reset_index(drop=True, inplace=True)
581581
else:
582+
toupdatedf = pd.DataFrame()
582583
logger.info("No updated rows")
583584
return toupdatedf
584585

@@ -613,11 +614,15 @@ def _update_rows(new_datasetdf, databasedf, checkby):
613614
updatesetdf = updatesetdf.loc[updating_databasedf.index]
614615
# Index comparison
615616
# check row content differences only
616-
differences = updatesetdf.drop(
617-
columns=["ROW_ID", "ROW_VERSION"]
618-
) != updating_databasedf.drop(columns=["ROW_ID", "ROW_VERSION"])
617+
if "ROW_ID" in updatesetdf.columns and "ROW_VERSION" in updatesetdf.columns:
618+
differences = updatesetdf.drop(
619+
columns=["ROW_ID", "ROW_VERSION"]
620+
) != updating_databasedf.drop(columns=["ROW_ID", "ROW_VERSION"])
621+
else:
622+
differences = updatesetdf != updating_databasedf.drop(
623+
columns=["ROW_ID", "ROW_VERSION"]
624+
)
619625
differentrows = differences.apply(sum, axis=1) > 0
620-
621626
toupdatedf = _create_update_rowsdf(updating_databasedf, updatesetdf, differentrows)
622627

623628
return toupdatedf

0 commit comments

Comments
 (0)