@@ -61,6 +61,16 @@ def generate_gexf_nodes_for_topics(self, topics):
6161 topics_lower = [t .lower () for t in topics ]
6262 placeholders = "," .join (["?" ] * len (topics_lower ))
6363
64+ # Debug: Check what columns actually exist in the repos table
65+ schema_query = "DESCRIBE repos"
66+ # try:
67+ # schema_result = self.con.execute(schema_query).fetchall()
68+ # # print("Repos table schema:")
69+ # # for col in schema_result:
70+ # # print(f" {col}")
71+ # except Exception as e:
72+ # print(f"Could not get schema: {e}")
73+
6474 query = f"""
6575 WITH repo_topics_agg AS (
6676 SELECT r.nameWithOwner,
@@ -70,7 +80,7 @@ def generate_gexf_nodes_for_topics(self, topics):
7080 WHERE LOWER(t.topic) IN ({ placeholders } )
7181 GROUP BY r.nameWithOwner
7282 )
73- SELECT DISTINCT r.nameWithOwner, r.stars, r.forks, r.watchers, r.isFork, r. isArchived,
83+ SELECT DISTINCT r.nameWithOwner, r.stars, r.forks, r.watchers, r.isArchived,
7484 r.languageCount, r.pullRequests, r.issues, r.primaryLanguage, r.createdAt,
7585 r.license, rt.topics
7686 FROM repos r
@@ -79,12 +89,17 @@ def generate_gexf_nodes_for_topics(self, topics):
7989 WHERE LOWER(t.topic) IN ({ placeholders } )
8090 """
8191 result = self .con .execute (query , topics_lower + topics_lower ).fetchall ()
92+
93+ # Debug: Print the first few rows to see what we're getting
94+ if result :
95+ print (f"First row sample: { result [0 ]} " )
96+ print (f"Number of results: { len (result )} " )
97+
8298 columns = [
8399 "nameWithOwner" ,
84100 "stars" ,
85101 "forks" ,
86102 "watchers" ,
87- "isFork" ,
88103 "isArchived" ,
89104 "languageCount" ,
90105 "pullRequests" ,
@@ -102,7 +117,6 @@ def generate_gexf_nodes_for_topics(self, topics):
102117 "stars" : 0 ,
103118 "forks" : 0 ,
104119 "watchers" : 0 ,
105- "isFork" : False ,
106120 "isArchived" : False ,
107121 "languageCount" : 0 ,
108122 "pullRequests" : 0 ,
@@ -119,7 +133,6 @@ def generate_gexf_nodes_for_topics(self, topics):
119133 'stars' : {'type' : 'integer' },
120134 'forks' : {'type' : 'integer' },
121135 'watchers' : {'type' : 'integer' },
122- 'isFork' : {'type' : 'boolean' },
123136 'isArchived' : {'type' : 'boolean' },
124137 'languageCount' : {'type' : 'integer' },
125138 'pullRequests' : {'type' : 'integer' },
@@ -157,6 +170,9 @@ def generate_gexf_nodes_for_topics(self, topics):
157170 elif col == "topics" :
158171 # Store topics as a comma-separated string
159172 node_attrs [col ] = val if val else default_values [col ]
173+ elif col == "isArchived" :
174+ # Ensure isArchived is always a boolean value
175+ node_attrs [col ] = bool (val ) if val is not None else False
160176 else :
161177 # Use default value if the value is None
162178 node_attrs [col ] = default_values [col ] if val is None else val
0 commit comments