Fix the frontend API calls and implement logins on frontend #7
@@ -127,8 +127,8 @@ class InteractionAnalysis:
|
||||
def interaction_graph(self, df: pd.DataFrame):
|
||||
interactions = {a: {} for a in df["author"].dropna().unique()}
|
||||
|
||||
# reply_to refers to the comment id, this allows us to map comment ids to usernames
|
||||
id_to_author = df.set_index("id")["author"].to_dict()
|
||||
# reply_to refers to the comment id, this allows us to map comment/post ids to usernames
|
||||
id_to_author = df.set_index("post_id")["author"].to_dict()
|
||||
|
||||
for _, row in df.iterrows():
|
||||
a = row["author"]
|
||||
|
||||
@@ -52,6 +52,7 @@ class DatasetManager:
|
||||
query = """
|
||||
INSERT INTO events (
|
||||
dataset_id,
|
||||
post_id,
|
||||
type,
|
||||
parent_id,
|
||||
author,
|
||||
@@ -78,13 +79,14 @@ class DatasetManager:
|
||||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s,
|
||||
%s, %s, %s, %s, %s,
|
||||
%s
|
||||
%s, %s
|
||||
)
|
||||
"""
|
||||
|
||||
values = [
|
||||
(
|
||||
dataset_id,
|
||||
row["id"],
|
||||
row["type"],
|
||||
row["parent_id"],
|
||||
row["author"],
|
||||
|
||||
@@ -30,6 +30,8 @@ CREATE TABLE events (
|
||||
/* Required Fields */
|
||||
id SERIAL PRIMARY KEY,
|
||||
dataset_id INTEGER NOT NULL,
|
||||
|
||||
post_id VARCHAR(255) NOT NULL,
|
||||
type VARCHAR(255) NOT NULL,
|
||||
|
||||
author VARCHAR(255) NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user