From e54225e668b1f8bfabb3e80678bd3bcbe5d2ce7a Mon Sep 17 00:00:00 2001 From: james Date: Tue, 1 Oct 2024 14:59:04 +0800 Subject: [PATCH] Do rename trackId if it has not already been added --- adscrawler/app_stores/apple.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adscrawler/app_stores/apple.py b/adscrawler/app_stores/apple.py index 3f0c0ca..09556d0 100644 --- a/adscrawler/app_stores/apple.py +++ b/adscrawler/app_stores/apple.py @@ -128,6 +128,8 @@ def scrape_app_ios(store_id: str, country: str) -> dict: def clean_ios_app_df(df: pd.DataFrame) -> pd.DataFrame: + if 'store_id' not in df.columns: + df = df.rename(columns={"trackId": "store_id"}) df = df.rename( columns={ # "trackId": "store_id",