Skip to content

Commit

Permalink
Add aliases to subqueries
Browse files Browse the repository at this point in the history
  • Loading branch information
MatRouillard committed Aug 27, 2024
1 parent a7cc869 commit e834512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Python/graph_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def getConnectedComponents(connection:psycopg2.extensions.connection,
SELECT COUNT(*)
FROM public.pgr_connectedComponents('SELECT id, source, target, cost, reverse_cost FROM {schema}.{edgeTableName}')
GROUP BY DISTINCT component
)"""
) AS sub;"""

# Execute query
cursor = utils.executeSelectQuery(connection, query)
Expand Down Expand Up @@ -501,7 +501,7 @@ def getStrongConnectedComponents(connection:psycopg2.extensions.connection,
SELECT COUNT(*)
FROM public.pgr_strongComponents('SELECT id, source, target, cost, reverse_cost FROM {schema}.{edgeTableName}')
GROUP BY DISTINCT component
)"""
) AS sub;"""

# Execute query
cursor = utils.executeSelectQuery(connection, query)
Expand Down

0 comments on commit e834512

Please sign in to comment.