Skip to content

Commit

Permalink
Standarizing messages & comments on deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Sep 12, 2023
1 parent 4ae00e0 commit 19bdc47
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 62 deletions.
2 changes: 1 addition & 1 deletion sql/driving_distance/_drivingDistance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ LANGUAGE c VOLATILE STRICT;
-- COMMENTS

COMMENT ON FUNCTION _pgr_drivingDistance(TEXT, ANYARRAY, FLOAT, BOOLEAN, BOOLEAN)
IS 'pgRouting deprecated function';
IS 'pgRouting internal function deprecated on v3.6.0';
2 changes: 1 addition & 1 deletion sql/driving_distance/_withPointsDD.sql
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ LANGUAGE C VOLATILE STRICT;
-- COMMENTS

COMMENT ON FUNCTION _pgr_withPointsDD(TEXT, TEXT, ANYARRAY, FLOAT, BOOLEAN, CHAR, BOOLEAN, BOOLEAN)
IS 'pgRouting deprecated function';
IS 'pgRouting internal function deprecated on v3.6.0';
15 changes: 8 additions & 7 deletions sql/driving_distance/withPointsDD.sql
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ CREATE FUNCTION pgr_withPointsDD(
RETURNS SETOF RECORD AS
$BODY$
BEGIN
RAISE WARNING 'pgr_withpointsdd(text,text,bigint,double precision,boolean,character,boolean) is been deprecated';
RAISE WARNING 'pgr_withpointsdd(text,text,bigint,double precision,boolean,character,boolean) deprecated signature on 3.6.0';
RETURN QUERY
SELECT a.seq, a.node, a.edge, a.cost, a.agg_cost
FROM _pgr_withPointsDD(_pgr_get_statement($1), _pgr_get_statement($2), ARRAY[$3]::BIGINT[], $4, $5, $6, $7, false) AS a;
Expand Down Expand Up @@ -177,10 +177,10 @@ CREATE FUNCTION pgr_withPointsDD(
RETURNS SETOF RECORD AS
$BODY$
BEGIN
RAISE WARNING 'pgr_withpointsdd(text,text,anyarray,double precision,boolean,character,boolean,boolean) is been deprecated';
RAISE WARNING 'pgr_withpointsdd(text,text,anyarray,double precision,boolean,character,boolean,boolean) deprecated signature on v3.6.0';
RETURN QUERY
SELECT *
FROM _pgr_withPointsDD(_pgr_get_statement($1), _pgr_get_statement($2), $3, $4, $5, $6, $7, $8);
SELECT a.seq, a.start_vid, a.node, a.edge, a.cost, a.agg_cost
FROM _pgr_withPointsDD(_pgr_get_statement($1), _pgr_get_statement($2), $3, $4, $5, $6, $7, $8) AS a;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
Expand All @@ -191,8 +191,9 @@ ROWS 1000;
-- COMMENTS

COMMENT ON FUNCTION pgr_withPointsDD(TEXT, TEXT, BIGINT, FLOAT, BOOLEAN, CHAR, BOOLEAN)
IS 'pgRouting deprecated function';

IS 'pgRouting deprecated signature on v3.6.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_withPointsDD.html';

COMMENT ON FUNCTION pgr_withPointsDD(TEXT, TEXT, ANYARRAY, FLOAT, BOOLEAN, CHAR, BOOLEAN, BOOLEAN)
IS 'pgRouting deprecated function';
IS 'pgRouting deprecated signature on v3.6.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_withPointsDD.html';
2 changes: 1 addition & 1 deletion sql/ksp/_withPointsKSP.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ CREATE FUNCTION _pgr_withPointsKSP(
-- COMMENTS

COMMENT ON FUNCTION _pgr_withPointsKSP(TEXT, TEXT, BIGINT, BIGINT, INTEGER, BOOLEAN, BOOLEAN, CHAR, BOOLEAN)
IS 'pgRouting deprecated function';
IS 'pgRouting internal function deprecated on v3.6.0';
21 changes: 3 additions & 18 deletions sql/ksp/withPointsKSP.sql
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ CREATE FUNCTION pgr_withPointsKSP(
RETURNS SETOF RECORD AS
$BODY$
BEGIN
RAISE WARNING 'pgr_withPointsKSP(text,text,bigint,bigint,integer,boolean,boolean,char,boolean) deprecated on v3.6.0';
RAISE WARNING 'pgr_withPointsKSP(text,text,bigint,bigint,integer,boolean,boolean,char,boolean) deprecated signature on v3.6.0';
RETURN QUERY
SELECT * FROM _pgr_withPointsKSP(_pgr_get_statement($1), _pgr_get_statement($2), $3, $4, $5, $6, $7, $8, $9);
END
Expand All @@ -301,20 +301,5 @@ ROWS 1000;
-- COMMENTS

COMMENT ON FUNCTION pgr_withPointsKSP(TEXT, TEXT, BIGINT, BIGINT, INTEGER, BOOLEAN, BOOLEAN, CHAR, BOOLEAN)
IS 'pgr_withPointsKSP
- Deprecated signature in v3.6.0
- PROPOSED
- Parameters:
- Edges SQL with columns: id, source, target, cost [,reverse_cost]
- Points SQL with columns: [pid], edge_id, fraction[,side]
- From vertex identifier
- To vertex identifier
- K
- Optional Parameters
- directed := true
- heap paths := false
- driving side := b
- details := false
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_withPointsKSP.html
';
IS 'pgr_withPointsKSP deprecated signature on v3.6.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_withPointsKSP.html';
13 changes: 4 additions & 9 deletions sql/max_flow/maxCardinalityMatch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CREATE FUNCTION pgr_maxCardinalityMatch(
RETURNS SETOF RECORD AS
$BODY$
BEGIN
RAISE WARNING 'pgr_maxCardinalityMatch(text,boolean) deprecated on v3.4.0';
RAISE WARNING 'pgr_maxCardinalityMatch(text,boolean) deprecated signature on v3.4.0';
RETURN QUERY SELECT *
FROM _pgr_maxCardinalityMatch(_pgr_get_statement($1), $2);
END
Expand All @@ -63,18 +63,13 @@ ROWS 1000;

-- COMMENTS
COMMENT ON FUNCTION pgr_maxCardinalityMatch(TEXT, BOOLEAN)
IS 'pgr_maxCardinalityMatch
- DEPRECATED signature on v3.4.0
- Use without boolean paramater
- Regardless of boolen value it will work for undirected graphs
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_maxCardinalityMatch.html
';
IS 'pgr_maxCardinalityMatch deprecated signature on v3.4.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_maxCardinalityMatch.html';

COMMENT ON FUNCTION pgr_maxCardinalityMatch(TEXT)
IS 'pgr_maxCardinalityMatch
- Parameters:
- Edges SQL with columns: id, source, target, cost [,reverse_cost]
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_maxCardinalityMatch.html
- ${PROJECT_DOC_LINK}/pgr_maxCardinalityMatch.html
';
18 changes: 6 additions & 12 deletions sql/trsp/pgr_trsp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ new_sql TEXT;
restrictions_query TEXT;
trsp_sql TEXT;
BEGIN
RAISE WARNING 'pgr_trsp(text,integer,integer,boolean,boolean) deprecated on v3.4.0';
RAISE WARNING 'pgr_trsp(text,integer,integer,boolean,boolean) deprecated signature on v3.4.0';
has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);

new_sql := edges_sql;
Expand Down Expand Up @@ -159,7 +159,7 @@ BEGIN
IF $2 IS NULL OR $3 IS NULL OR $4 IS NULL OR $5 IS NULL OR $6 IS NULL THEN
RETURN;
END IF;
RAISE WARNING 'pgr_trsp(text,integer,float,integer,float,boolean,boolean) deprecated on v3.4.0';
RAISE WARNING 'pgr_trsp(text,integer,float,integer,float,boolean,boolean) deprecated signature on v3.4.0';
has_reverse =_pgr_parameter_check('dijkstra', sql, false);

new_sql := sql;
Expand Down Expand Up @@ -259,16 +259,10 @@ ROWS 1000;
-- COMMENTS

COMMENT ON FUNCTION pgr_trsp(TEXT, INTEGER, INTEGER, BOOLEAN, BOOLEAN, TEXT)
IS 'pgr_trsp
- DEPRECATED signature on v3.4.0
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_trsp.html
';
IS 'pgr_trsp deprecated signature on v3.4.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_trsp.html';


COMMENT ON FUNCTION pgr_trsp(TEXT, INTEGER, FLOAT, INTEGER, FLOAT, BOOLEAN, BOOLEAN, TEXT)
IS 'pgr_trsp
- DEPRECATED signature on v3.4.0
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_trsp_withPoints.html
';
IS 'pgr_trsp deprecated signature on v3.4.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_trsp_withPoints.html';
9 changes: 3 additions & 6 deletions sql/trsp/pgr_trspViaEdges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ declare
f float;

begin
RAISE WARNING 'pgr_trspViaEdges(text,integer[],float[],boolean,boolean,text) deprecated on v3.4.0';
RAISE WARNING 'pgr_trspViaEdges(text,integer[],float[],boolean,boolean,text) deprecated function on v3.4.0';
SELECT 0::INTEGER AS seq, NULL::INTEGER AS id1, NULL::INTEGER AS id2, NULL::INTEGER AS id3, NULL::FLOAT AS cost INTO lrr;
has_reverse =_pgr_parameter_check('dijkstra', sql, false);
edges_sql := sql;
Expand Down Expand Up @@ -173,8 +173,5 @@ rows 1000;
-- COMMENTS

COMMENT ON FUNCTION pgr_trspViaEdges(TEXT, INTEGER[], FLOAT[], BOOLEAN, BOOLEAN, TEXT)
IS 'pgr_trspViaEdges
- DEPRECATED function on v3.4.0
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_trspVia_withPoints.html
';
IS 'pgr_trspViaEdges deprecated function on v3.4.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_trspVia_withPoints.html';
9 changes: 3 additions & 6 deletions sql/trsp/pgr_trspViaVertices.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DECLARE
has_reverse BOOLEAN;
new_sql TEXT;
BEGIN
RAISE WARNING 'pgr_trspViaVertices(text,anyarray,boolean,boolean,text) is been deprecated';
RAISE WARNING 'pgr_trspViaVertices(text,anyarray,boolean,boolean,text) deprecated function on v3.4.0';

has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);

Expand Down Expand Up @@ -94,8 +94,5 @@ ROWS 1000;
-- COMMENTS

COMMENT ON FUNCTION pgr_trspViaVertices(TEXT, ANYARRAY, BOOLEAN, BOOLEAN, TEXT)
IS 'pgr_trspViaVertices
- DEPRECATED function on v3.4.0
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_trspVia.html
';
IS 'pgr_trspViaVertices deprecated function on v3.4.0
- Documentation: ${PROJECT_DOC_LINK}/pgr_trspVia.html';
2 changes: 1 addition & 1 deletion sql/withPoints/withPointsVia.sql
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,4 @@ CREATE FUNCTION _pgr_withPointsVia(


COMMENT ON FUNCTION _pgr_withPointsVia(TEXT, BIGINT[], FLOAT[], BOOLEAN)
IS 'pgRouting internal function DEPRECATED on v3.4.0';
IS 'pgRouting internal function deprecated on v3.4.0';

0 comments on commit 19bdc47

Please sign in to comment.