SaiBon99 commited on
Commit
b8043cd
·
1 Parent(s): 270b534

Refactor load_phishing_urls.py to include URL IDs and update primary key for DataFrame

Browse files
src/phising_detection/data/load_phishing_urls.py CHANGED
@@ -69,7 +69,11 @@ def request_phishing_urls(links):
69
 
70
 
71
  # Create DataFrame
72
- df = pd.DataFrame(all_urls, columns=["Phishing_URL"])
 
 
 
 
73
 
74
  return df
75
 
@@ -87,9 +91,9 @@ def load_into_hopswork(dataframe):
87
  project=project,
88
  df=dataframe,
89
  feature_group_name="phishing_urls",
90
- version=1,
91
  description="A dataframe with all the active Phishing URLs collected from the updated Phishing database",
92
- primary_key= ["phishing_url"],
93
  event_time= None,
94
  online_enabled=True
95
  )
 
69
 
70
 
71
  # Create DataFrame
72
+ df = pd.DataFrame({
73
+ 'url_id': range(len(all_urls)),
74
+ 'url': all_urls,
75
+ 'is_phishing': 0 # 0 for legitimate URLs
76
+ })
77
 
78
  return df
79
 
 
91
  project=project,
92
  df=dataframe,
93
  feature_group_name="phishing_urls",
94
+ version=2,
95
  description="A dataframe with all the active Phishing URLs collected from the updated Phishing database",
96
+ primary_key= ["url_id"],
97
  event_time= None,
98
  online_enabled=True
99
  )