From 8e9ef3ecc0f7529d19c657a001a4a04654b773f8 Mon Sep 17 00:00:00 2001 From: FlorentLvr Date: Mon, 22 Apr 2024 09:42:43 +0200 Subject: [PATCH] fix: split text not working with school to enrich org --- .../domain/Growth_Create_organizations_db.ipynb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/models/growth-engine/core/domain/Growth_Create_organizations_db.ipynb b/models/growth-engine/core/domain/Growth_Create_organizations_db.ipynb index 1a69342..79db8b7 100644 --- a/models/growth-engine/core/domain/Growth_Create_organizations_db.ipynb +++ b/models/growth-engine/core/domain/Growth_Create_organizations_db.ipynb @@ -475,9 +475,16 @@ " if \"company\" in linkedin_url and organization_id == \"TBD\" and call_linkedin < limit_linkedin and (interaction_score >= 3 or call_linkedin < limit_linkedin):\n", " print()\n", " print(f\"{count} - 🕸️ LinkedIn - Enrich data for '{organization}': {int(interaction_score)} ({linkedin_url})\")\n", - " linkedin_dir = os.path.join(datalake_dir, \"datalake\", \"linkedin\", \"organizations\") \n", - " linkedin_id = linkedin_url.split(\"/company/\")[1].split(\"/\")[0]\n", - " tmp_df = pload(linkedin_dir, f\"{linkedin_id}_linkedin_company_info\")\n", + " linkedin_dir = os.path.join(datalake_dir, \"datalake\", \"linkedin\", \"organizations\")\n", + " split_text = \"\"\n", + " if \"company\" in linkedin_url:\n", + " split_text = \"company\"\n", + " if \"showcase\" in linkedin_url:\n", + " split_text = \"showcase\"\n", + " if \"school\" in linkedin_url:\n", + " split_text = \"school\"\n", + " linkedin_id = linkedin_url.split(f\"/{split_text}/\")[1].split(\"/\")[0]\n", + " tmp_df = pload(linkedin_dir, f\"{linkedin_id}_linkedin_{split_text}_info\")\n", " if tmp_df is None:\n", " try:\n", " tmp_df = linkedin.connect(li_at, JSESSIONID).company.get_info(linkedin_url)\n",