Commit ·
3cb83db
1
Parent(s): 2862dc5
- adding user_profile for test
Browse files- connecting to recsys_v3 results
- fixing role to read data properly
Messaging_system/DataCollector.py
CHANGED
|
@@ -24,10 +24,10 @@ class DataCollector:
|
|
| 24 |
|
| 25 |
# selecting a sample of users
|
| 26 |
self.select_sample()
|
| 27 |
-
|
| 28 |
|
| 29 |
# calculate the remaining days to their birthday
|
| 30 |
-
|
| 31 |
self.create_columns()
|
| 32 |
|
| 33 |
# # creating additional info if applicable
|
|
|
|
| 24 |
|
| 25 |
# selecting a sample of users
|
| 26 |
self.select_sample()
|
| 27 |
+
self.fetch_data()
|
| 28 |
|
| 29 |
# calculate the remaining days to their birthday
|
| 30 |
+
self.remaining_days_to_birthday()
|
| 31 |
self.create_columns()
|
| 32 |
|
| 33 |
# # creating additional info if applicable
|
Messaging_system/PromptGenerator.py
CHANGED
|
@@ -50,7 +50,7 @@ Here is the information about the user:
|
|
| 50 |
- {self.safe_get(self.Core.segment_info)}
|
| 51 |
- first name: {self.safe_get(user.get("first_name"))}
|
| 52 |
|
| 53 |
-
**user_profile**
|
| 54 |
|
| 55 |
{self.safe_get(user.get("user_info"))}
|
| 56 |
|
|
|
|
| 50 |
- {self.safe_get(self.Core.segment_info)}
|
| 51 |
- first name: {self.safe_get(user.get("first_name"))}
|
| 52 |
|
| 53 |
+
**user_profile (Preferences):**
|
| 54 |
|
| 55 |
{self.safe_get(user.get("user_info"))}
|
| 56 |
|
Messaging_system/SnowFlakeConnection.py
CHANGED
|
@@ -160,10 +160,10 @@ class SnowFlakeConn:
|
|
| 160 |
else :
|
| 161 |
condition = ""
|
| 162 |
|
| 163 |
-
recsys_col = f"{self.brand}
|
| 164 |
query = f"""
|
| 165 |
select USER_ID, {recsys_col} as recsys_result
|
| 166 |
-
from
|
| 167 |
{condition}
|
| 168 |
"""
|
| 169 |
return query
|
|
@@ -173,7 +173,7 @@ class SnowFlakeConn:
|
|
| 173 |
|
| 174 |
query = f"""
|
| 175 |
select POPULAR_CONTENT
|
| 176 |
-
from
|
| 177 |
where brand = '{self.brand.lower()}'
|
| 178 |
"""
|
| 179 |
|
|
|
|
| 160 |
else :
|
| 161 |
condition = ""
|
| 162 |
|
| 163 |
+
recsys_col = f"{self.brand}_recsys_v3"
|
| 164 |
query = f"""
|
| 165 |
select USER_ID, {recsys_col} as recsys_result
|
| 166 |
+
from RECSYS_V3.RECSYS_CIO.RECSYS_V3_CUSTOMER_IO_OLD
|
| 167 |
{condition}
|
| 168 |
"""
|
| 169 |
return query
|
|
|
|
| 173 |
|
| 174 |
query = f"""
|
| 175 |
select POPULAR_CONTENT
|
| 176 |
+
from RECSYS_V3.RECSYS_CIO.POPULAR_CONTENT_CUSTOMER_IO_OLD
|
| 177 |
where brand = '{self.brand.lower()}'
|
| 178 |
"""
|
| 179 |
|