Skip to content

GML-2077 Release 2.0.3#286

Merged
chengbiao-jin merged 6 commits intomasterfrom
release_2.0.3
Apr 16, 2026
Merged

GML-2077 Release 2.0.3#286
chengbiao-jin merged 6 commits intomasterfrom
release_2.0.3

Conversation

@chengbiao-jin
Copy link
Copy Markdown
Collaborator

@chengbiao-jin chengbiao-jin commented Apr 15, 2026

PR Type

Bug fix, Enhancement, Tests, Documentation


Description

  • Fix host URL port extraction

    • Prevent double-port request URLs
    • Validate URL and explicit port conflicts
    • Apply defaults only when unset
  • Correct timeout and header precedence

    • Use single HTTP timeout value
    • Let request headers override defaults
    • Default loading timeout to server-managed
  • Add graph drop cascade support

    • Support cascade in sync and async schema APIs
    • Use query param or GSQL fallback
  • Release 2.0.3 packaging updates

    • Update changelog and project version
    • Fix PEP 639 license metadata
    • Refresh conda recipe handling

Diagram Walkthrough

flowchart LR
  host["Host URL with optional port"]
  parse["Extract hostname and port"]
  validate["Validate against explicit ports"]
  urls["Build clean `host`, `restppUrl`, `gsUrl`"]
  headers["Merge default and request headers"]
  timeout["Derive single HTTP timeout"]
  loading["Loading jobs use default `timeout=0`"]
  drop["`dropGraph(cascade=...)` support"]
  tests["Regression tests added"]

  host -- "parsed by" --> parse
  parse -- "checks conflicts" --> validate
  validate -- "produces" --> urls
  headers -- "drives" --> timeout
  timeout -- "used by" --> loading
  urls -- "covered by" --> tests
  timeout -- "covered by" --> tests
  drop -- "covered in API changes" --> tests
Loading

File Walkthrough

Relevant files
Bug fix
5 files
base.py
Parse host URL ports and fix header precedence                     
+41/-6   
pyTigerGraphBase.py
Use single HTTP timeout value                                                       
+5/-5     
pyTigerGraphLoading.py
Default loading job timeout to zero                                           
+4/-4     
pyTigerGraphBase.py
Align async timeout handling with sync                                     
+6/-8     
pyTigerGraphLoading.py
Default async loading timeout to zero                                       
+4/-4     
Enhancement
4 files
pyTigerGraph.py
Allow unset default connection ports                                         
+2/-2     
pyTigerGraphSchema.py
Add cascade option to graph deletion                                         
+11/-4   
pyTigerGraph.py
Allow unset default async connection ports                             
+2/-2     
pyTigerGraphSchema.py
Add async cascade graph deletion support                                 
+11/-4   
Tests
1 files
test_v202_changes.py
Add regression tests for ports and timeouts                           
+197/-0 
Configuration changes
3 files
build.sh
Simplify conda recipe version and sha update                         
+8/-41   
pyproject.toml
Bump version and fix license metadata                                       
+2/-3     
meta.yaml
Template recipe version and set sha256                                     
+4/-3     
Documentation
1 files
CHANGELOG.md
Document `2.0.3` fixes and release notes                                 
+10/-0   

Extract port from host URL (e.g. http://ip:14240) and strip it from
self.host to prevent malformed URLs like http://ip:14240:9000. The
extracted port is validated against explicitly provided restppPort/gsPort
and used to fill in any ports not explicitly set. Default restppPort and
gsPort changed from "9000"/"14240" to None across all __init__ signatures
so explicit vs default can be reliably distinguished.

Also fix pyproject.toml license deprecation warning (table -> string).
setuptools rejects having both license = "Apache-2.0" and the old
License :: OSI Approved classifier simultaneously.
Bump version to 2.0.3 with host URL port extraction fix and
PEP 639 license classifier fix from release_2.0.2.
…aph cascade

- Fix socket timeout during large file uploads by using a single timeout
  value instead of (connect, read) tuple, preventing 30s connect timeout
  from killing long uploads
- Fix header merge order so per-request headers override responseConfigHeader
- Change loading job default timeout from 16000ms to 0 (use server-wide timeout)
- Add cascade parameter to dropGraph() for TigerGraph 4.0+
- Add unit tests for timeout and header precedence behavior
@tg-pr-agent
Copy link
Copy Markdown

tg-pr-agent Bot commented Apr 15, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Empty Host

Host parsing now relies on urlparse(...).hostname, which can be None for malformed but scheme-valid inputs. This may silently build invalid base URLs like http://None instead of failing fast, so host validation should be verified for bad inputs.

# Extract port from URL if present (e.g. http://192.168.11.11:14240)
# Use hostname (without port) to avoid double-port URLs later.
hostOnly = inputHost.hostname
hostPort = inputHost.port  # int or None
if hostPort is not None:
    _hp = str(hostPort)
    _restpp_explicit = restppPort is not None
    _gs_explicit = gsPort is not None
    if _restpp_explicit and _gs_explicit:
        # Both ports explicitly provided — URL port must match one.
        if str(restppPort) != _hp and str(gsPort) != _hp:
            raise TigerGraphException(
                "Port {0} in host URL conflicts with restppPort={1} and gsPort={2}. "
                "The URL port must match restppPort or gsPort when both are specified."
                .format(hostPort, restppPort, gsPort), "E-0003")
    elif _restpp_explicit and str(restppPort) != _hp:
        raise TigerGraphException(
            "Port {0} in host URL conflicts with restppPort={1}. "
            "Specify the port in the URL or via restppPort, not both."
            .format(hostPort, restppPort), "E-0003")
    elif _gs_explicit and str(gsPort) != _hp:
        raise TigerGraphException(
            "Port {0} in host URL conflicts with gsPort={1}. "
            "Specify the port in the URL or via gsPort, not both."
            .format(hostPort, gsPort), "E-0003")
    # Fill in non-explicit ports from URL port
    if not _restpp_explicit:
        restppPort = _hp
    if not _gs_explicit:
        gsPort = _hp
# Apply defaults for any ports still unset
if restppPort is None:
    restppPort = "9000"
if gsPort is None:
    gsPort = "14240"
self.netloc = hostOnly
self.host = "{0}://{1}".format(inputHost.scheme, hostOnly)
if gsqlSecret != "":
Timeout Parsing

The new timeout derivation directly casts GSQL-TIMEOUT to int. If callers pass a non-numeric header value through custom headers, request preparation will now raise before sending the request instead of falling back safely.

if "GSQL-TIMEOUT" in _headers and int(_headers["GSQL-TIMEOUT"]) > 0:
    http_timeout = int(int(_headers["GSQL-TIMEOUT"])/1000) + 30
else:
    http_timeout = None
Version Guard

The implementation adds CASCADE to the GSQL fallback path for versions below 4.0, while the docstring says cascade is only supported on TigerGraph 4.0 and above. This mismatch should be validated against actual server compatibility to avoid sending unsupported GSQL.

cmd = f"DROP GRAPH {graphName}"
if cascade:
    cmd += " CASCADE"
res = _wrap_gsql_result(self.gsql(cmd))

Comment thread pyTigerGraph/common/base.py
Comment thread pyTigerGraph/pyTigerGraphSchema.py
@chengbiao-jin chengbiao-jin changed the title Release 2.0.3 GML-2077 Release 2.0.3 Apr 15, 2026
…eholder in recipe

- Raise TigerGraphException for empty or malformed hostname after urlparse
- Catch ValueError from out-of-range port in host URL
- Remove incorrect "Only supported on TigerGraph >= 4.0" from dropGraph cascade docstring
- Use sha256 placeholder in conda recipe for build.sh to populate
Copy link
Copy Markdown
Collaborator Author

@chengbiao-jin chengbiao-jin left a comment

Choose a reason for hiding this comment

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

Resolved

@chengbiao-jin chengbiao-jin merged commit 565697d into master Apr 16, 2026
@chengbiao-jin chengbiao-jin deleted the release_2.0.3 branch April 16, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant