Skip to content

Commit

Permalink
26 fix flagging script mismatch between s3 and local (ccao-data#32)
Browse files Browse the repository at this point in the history
Change S3 flagging script pandas code
  • Loading branch information
wagnerlmichael authored Oct 3, 2023
1 parent fa44baf commit 3387b11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,9 @@ def get_sale_counts(dups: pd.DataFrame) -> pd.DataFrame:
df (pd.DataFrame): pandsa dataframe4
"""
v_counts = (
dups.pin.value_counts().reset_index()
# .rename(columns={"count": "sv_sale_dup_counts"})
.rename(columns={"index": "pin", "pin": "sv_sale_dup_counts"})
dups.pin.value_counts()
.reset_index()
.rename(columns={"count": "sv_sale_dup_counts"})
)

dups = pd.merge(dups, v_counts)
Expand Down
2 changes: 1 addition & 1 deletion glue/sales_val_flagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def write_to_table(df, table_name, s3_warehouse_bucket_path, run_id):
df_to_write=rows_to_append,
df_ingest=df_ingest_full,
iso_forest_cols=iso_forest_list,
res_stat_groups=inputs["stat_groups"],
res_stat_groups=stat_groups_list,
condo_stat_groups=condo_stat_groups,
dev_bounds=dev_bounds_list,
ptax_sd=ptax_sd_list,
Expand Down
1 change: 0 additions & 1 deletion manual_flagging/src/flagging_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ def get_sale_counts(dups: pd.DataFrame) -> pd.DataFrame:
dups.pin.value_counts()
.reset_index()
.rename(columns={"count": "sv_sale_dup_counts"})
# .rename(columns={"index": "pin", "pin": "sv_sale_dup_counts"})
)

dups = pd.merge(dups, v_counts)
Expand Down

0 comments on commit 3387b11

Please sign in to comment.