Skip to content

Deprecate pgr create vertices table #2829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Apr 8, 2025

Fixes #2826 .

Changes proposed in this pull request:

  • Deprecation message into the function
  • Migration instructions
  • Removes use of function on pgtap and docqueries

@pgRouting/admins

Summary by CodeRabbit

  • Documentation

    • Added a release notes entry for version 3.8.0 and a migration section explaining changes in vertex table creation.
    • Updated various docs to mark the vertex table function as deprecated and removed outdated references in favor of alternative approaches.
  • Tests

    • Revised SQL test scripts to verify the new vertex table creation process and to include deprecation warnings.
  • Chores

    • Improved error messaging to guide users toward the updated method for creating vertex tables.

Copy link
Contributor

coderabbitai bot commented Apr 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes document and enforce the deprecation of the pgr_createVerticesTable function in version 3.8.0. New release notes and migration sections have been added to guide users toward creating vertices tables using alternative routines, such as pgr_extractVertices and pgr_createTopology. Documentation across various files has been updated to remove redundant references and warnings added to SQL examples signal the deprecation. Additionally, changes to test scripts and utility SQL files ensure that the new workflow is correctly implemented and that error messages reflect the updated guidance.

Changes

File(s) Change Summary
NEWS.md, doc/src/release_notes.rst, doc/src/migration.rst, locale/en/LC_MESSAGES/pgrouting_doc_strings.po, locale/pot/pgrouting_doc_strings.pot, doc/topology/pgr_createVerticesTable.rst Added new release note entry and migration section for pgr_createVerticesTable; documentation updated to mark the function as deprecated since v3.8.0.
doc/_static/page_history.js Modified the version mapping for pgr_createVerticesTable by appending the numeric value 3.8.
doc/topology/pgr_analyzeGraph.rst, doc/topology/pgr_analyzeOneWay.rst, doc/topology/pgr_createTopology.rst, doc/topology/pgr_extractVertices.rst Removed references to pgr_createVerticesTable and updated instructions to focus solely on pgr_createTopology.
docqueries/topology/createVertTab-any.result, docqueries/topology/createVerticesTable.result Inserted deprecation warnings in SQL query examples for usage of the deprecated function.
pgtap/topology/analyzeGraph/issue_1311.pg, pgtap/topology/analyzeOneWay/edge_cases.pg, pgtap/topology/createVerticesTable/checkVertTab.pg Replaced calls to pgr_createVerticesTable with queries leveraging pgr_extractVertices to create new vertices tables.
sql/common/utilities_pgr.sql, sql/topology/createverticestable.sql Updated error messages and inline comments to remove references to the deprecated function, adding warnings regarding its deprecation.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant PG as pgRouting Library
    participant EV as pgr_extractVertices
    participant TT as Topology Functions

    U->>PG: Request vertices table creation
    PG->>TT: Validate creation method
    Note over PG,TT: pgr_createVerticesTable is deprecated
    PG->>EV: Call pgr_extractVertices to gather vertices data
    EV-->>PG: Return vertices data
    PG-->>U: Create vertices table using new process
Loading

Poem

I'm a bunny with a skip so light,
Hopping through docs in code delight,
Out with the old, in with the new,
Vertices crafted with a process true,
Deprecation warns in SQL bright,
For every change, I dance in byte,
Carrots and code—a rabbit's flight!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 33d4cc6 and 50103ae.

📒 Files selected for processing (18)
  • NEWS.md (1 hunks)
  • doc/_static/page_history.js (1 hunks)
  • doc/src/migration.rst (1 hunks)
  • doc/src/release_notes.rst (1 hunks)
  • doc/topology/pgr_analyzeGraph.rst (1 hunks)
  • doc/topology/pgr_analyzeOneWay.rst (2 hunks)
  • doc/topology/pgr_createTopology.rst (0 hunks)
  • doc/topology/pgr_createVerticesTable.rst (1 hunks)
  • doc/topology/pgr_extractVertices.rst (0 hunks)
  • docqueries/topology/createVertTab-any.result (18 hunks)
  • docqueries/topology/createVerticesTable.result (19 hunks)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (8 hunks)
  • locale/pot/pgrouting_doc_strings.pot (8 hunks)
  • pgtap/topology/analyzeGraph/issue_1311.pg (1 hunks)
  • pgtap/topology/analyzeOneWay/edge_cases.pg (1 hunks)
  • pgtap/topology/createVerticesTable/checkVertTab.pg (1 hunks)
  • sql/common/utilities_pgr.sql (1 hunks)
  • sql/topology/createverticestable.sql (2 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (1)
pgtap/common/checkVertTab.pg (1)

28-28: ⚠️ Potential issue

This test still uses the deprecated function pgr_createVerticesTable.

This test uses the function that's being deprecated in this PR. Consider updating this test to use the recommended approach with pgr_extractVertices instead, similar to changes made in other files.

#!/bin/bash
# Check if other test files have been updated to use the alternative approach
grep -r "pgr_createVerticesTable" pgtap/ | grep -v checkVertTab.pg
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33d4cc6 and 6bb114c.

📒 Files selected for processing (19)
  • NEWS.md (1 hunks)
  • doc/_static/page_history.js (1 hunks)
  • doc/src/migration.rst (1 hunks)
  • doc/src/release_notes.rst (1 hunks)
  • doc/topology/pgr_analyzeGraph.rst (1 hunks)
  • doc/topology/pgr_analyzeOneWay.rst (2 hunks)
  • doc/topology/pgr_createTopology.rst (0 hunks)
  • doc/topology/pgr_createVerticesTable.rst (1 hunks)
  • doc/topology/pgr_extractVertices.rst (0 hunks)
  • docqueries/topology/createVertTab-any.result (18 hunks)
  • docqueries/topology/createVerticesTable.result (19 hunks)
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po (8 hunks)
  • locale/pot/pgrouting_doc_strings.pot (8 hunks)
  • pgtap/common/checkVertTab.pg (1 hunks)
  • pgtap/topology/analyzeGraph/issue_1311.pg (1 hunks)
  • pgtap/topology/analyzeOneWay/edge_cases.pg (1 hunks)
  • pgtap/topology/createVerticesTable/checkVertTab.pg (1 hunks)
  • sql/common/utilities_pgr.sql (1 hunks)
  • sql/topology/createverticestable.sql (2 hunks)
💤 Files with no reviewable changes (2)
  • doc/topology/pgr_extractVertices.rst
  • doc/topology/pgr_createTopology.rst
👮 Files not reviewed due to content moderation or server errors (1)
  • locale/pot/pgrouting_doc_strings.pot
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Check queries
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: macos (macos-latest)
  • GitHub Check: macos (macos-14)
  • GitHub Check: Ubuntu clang
🔇 Additional comments (27)
locale/en/LC_MESSAGES/pgrouting_doc_strings.po (7)

3972-3976: LGTM: Clear reference to the deprecation issue

Good job adding a reference to the GitHub issue that prompted this deprecation, making it easier for users to understand the context behind this change.


4055-4056: LGTM: Clear migration section header

Good addition of a dedicated migration section that will help users understand how to transition away from the deprecated function.


4066-4077: LGTM: Comprehensive migration instructions

Excellent job providing both "Before Deprecation" and "After Deprecation" explanations. The clear recommendation to use pgr_extractVertices as an alternative helps users adapt to this change.


8047-8048: LGTM: Alternative function reference

Good update recommending pgr_createTopology as an alternative for creating the vertices table.


8281-8281: LGTM: Updated documentation reference

Good update to reference the recommended alternative function in the examples section.


8296-8296: LGTM: Consistent recommendation

Good job maintaining consistency by recommending pgr_createTopology throughout the documentation.


10152-10152: LGTM: Clear deprecation notice

Excellent deprecation notice that clearly specifies when the function was deprecated (version 3.8.0), helping users understand the timeline for this change.

pgtap/common/checkVertTab.pg (1)

1-1: Note the filename addition.

The file path has been added at the beginning of the file. This is a non-functional change that simply provides metadata about the file's location.

NEWS.md (1)

43-44: Good documentation of the deprecation.

The addition to the NEWS.md file properly documents the deprecation of pgr_createVerticesTable function in the release notes for version 3.8.0, referencing the relevant issue #2826.

pgtap/topology/analyzeOneWay/edge_cases.pg (1)

31-33: Good implementation of the alternative approach.

The code now uses pgr_extractVertices to create the vertices table instead of the deprecated pgr_createVerticesTable function. This aligns with the migration path documented in the PR objectives.

sql/common/utilities_pgr.sql (1)

285-285: Updated error message to remove reference to deprecated function.

The error message has been modified to remove the reference to pgr_createVerticesTable, now only suggesting _pgr_createTopology() for creating the vertex table. This is consistent with the deprecation plan.

docqueries/topology/createVertTab-any.result (1)

14-14: Consistent deprecation warnings correctly implemented.

The warnings have been consistently implemented across all calls to pgr_createVerticesTable, clearly indicating the function is deprecated in version 3.8.0.

Also applies to: 31-31, 48-48, 65-65, 82-82, 99-99, 116-116, 131-131, 150-150, 167-167, 184-184, 201-201, 218-218, 235-235, 254-254, 276-276, 294-294, 311-311

doc/src/release_notes.rst (1)

75-76: Documentation properly updated with deprecation notice.

The release notes correctly document the deprecation of pgr_createVerticesTable with a reference to the related GitHub issue #2826.

pgtap/topology/analyzeGraph/issue_1311.pg (1)

32-34: Good migration example from deprecated function to recommended approach.

This change demonstrates the recommended approach of replacing pgr_createVerticesTable with pgr_extractVertices. The replacement code properly:

  1. Creates all necessary columns
  2. Initializes additional tracking columns (cnt, chk, ein, eout) to zero
  3. Renames the geometry column to match expected convention

This serves as a good example for users migrating away from the deprecated function.

docqueries/topology/createVerticesTable.result (1)

7-7: Consistent deprecation warnings correctly implemented in test results.

The warnings have been properly added to all test scenarios involving pgr_createVerticesTable, maintaining consistency with other documentation and providing clear indication that this function is now deprecated.

Also applies to: 26-26, 44-44, 59-59, 78-78, 97-97, 116-116, 136-136, 161-161, 187-187, 205-205, 220-220, 241-241, 262-262, 283-283, 304-304, 321-321, 343-343, 360-360

doc/src/migration.rst (1)

27-45: Good addition of migration documentation for pgr_createVerticesTable.

This new section clearly explains the differences between the pre-deprecation and post-deprecation behavior, and provides guidance on using pgr_extractVertices as an alternative. The included code example will help users understand how to migrate their code.

doc/topology/pgr_analyzeOneWay.rst (2)

101-101: References to deprecated function properly removed.

The documentation correctly updates the reference to only recommend pgr_createTopology instead of the deprecated pgr_createVerticesTable function.


123-124: Appropriate update to vertices table creation guidance.

The instructions for creating vertices tables have been properly updated to recommend only using pgr_createTopology, aligning with the deprecation of pgr_createVerticesTable.

doc/_static/page_history.js (1)

219-219: Version marker added for deprecated function.

The version number 3.8 has been added to mark when pgr_createVerticesTable was deprecated, which helps maintain proper documentation versioning.

doc/topology/pgr_analyzeGraph.rst (1)

98-99: Documentation properly updated to remove deprecated function reference.

The instructions for creating the vertices table have been modified to solely reference pgr_createTopology, correctly removing mentions of the deprecated pgr_createVerticesTable function.

doc/topology/pgr_createVerticesTable.rst (4)

11-12: Updated index entries correctly reflect function deprecation.

The index entries now properly indicate that the pgr_createVerticesTable function is deprecated since version 3.8.0, which matches the PR objectives of marking this function as deprecated.


16-16: Function title now includes deprecation notice.

The title has been updated to include "Deprecated since 3.8.0", which is consistent with the index entries and helps to make the deprecation status clear to users.


24-26: Appropriately added deprecation notice in Availability section.

Adding this information under the "Availability" section follows proper documentation practice for deprecated functions, making it very clear to users that this function should no longer be used.


33-35: Migration guide inclusion will help users transition.

The inclusion of a migration guide is essential for helping users move away from the deprecated function. This directive will insert appropriate migration instructions from a separate file.

pgtap/topology/createVerticesTable/checkVertTab.pg (1)

1-51: Well-structured test file for verifying deprecated function behavior.

This new test file provides good coverage of the pgr_createVerticesTable functionality, ensuring that despite being deprecated, the function continues to work correctly until it is eventually removed.

A few observations:

  1. The test properly sets client_min_messages to WARNING to manage the output
  2. The test validates the structure of the created vertices table
  3. Error handling is tested with throws_ok for non-existent tables
  4. Test cleanup is handled through ROLLBACK

The test includes all necessary checks to ensure the function still operates as expected while being marked as deprecated.

sql/topology/createverticestable.sql (2)

99-99: Appropriately added deprecation warning message.

The warning message clearly indicates that the function is deprecated in version 3.8.0, which aligns with the documentation changes and PR objectives. The message is displayed when the function is called, ensuring users are aware of the deprecation.


268-268: Function comment updated to reflect deprecation status.

The function comment has been simplified to focus on the deprecation notice, which is appropriate since the function is being phased out. This matches the PR objective of deprecating the function.

@cvvergara cvvergara marked this pull request as draft April 8, 2025 12:03
@cvvergara cvvergara force-pushed the deprecate-pgr_createVerticesTable branch from 6bb114c to 7deae88 Compare April 8, 2025 12:55
@cvvergara cvvergara marked this pull request as ready for review April 8, 2025 14:01
@cvvergara cvvergara merged commit d96ce47 into pgRouting:main Apr 8, 2025
1 of 2 checks passed
@cvvergara cvvergara deleted the deprecate-pgr_createVerticesTable branch April 8, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate pgr_createVerticesTable in 3.8
2 participants