graphistry.compute.gfql.validate module#
Deprecated since version 2.0.0: This external validation module is deprecated. GFQL now has built-in validation that happens automatically during chain construction and execution.
See GFQL Validation Fundamentals for the new validation system and ../../gfql/validation_migration_guide for migration instructions.
GFQL query validation utilities for syntax and schema checking.
Deprecated since version 0.34.0: This module is deprecated. GFQL now has built-in validation. See /gfql/validation_migration_guide for migration instructions.
Instead of:
from graphistry.compute.gfql.validate import validate_syntax
issues = validate_syntax(query)
Use:
from graphistry.compute.chain import Chain
try:
chain = Chain(query) # Automatic validation
except GFQLValidationError as e:
print(f"[{e.code}] {e.message}")
- class graphistry.compute.gfql.validate.Schema(node_columns=None, edge_columns=None)#
Bases:
objectRepresents the schema of node and edge dataframes.
- Parameters:
node_columns (Dict[str, str] | None)
edge_columns (Dict[str, str] | None)
- class graphistry.compute.gfql.validate.ValidationIssue(level, message, operation_index=None, field=None, suggestion=None, error_type=None)#
Bases:
objectRepresents a validation issue (error or warning).
- Parameters:
level (str)
message (str)
operation_index (int | None)
field (str | None)
suggestion (str | None)
error_type (str | None)
- to_dict()#
Convert to dictionary for JSON serialization.
- Return type:
Dict[str, Any]
- graphistry.compute.gfql.validate.extract_schema(g)#
Extract schema from a Plottable object.
- Args:
g: Plottable object with node/edge data
- Returns:
Schema object
- graphistry.compute.gfql.validate.extract_schema_from_dataframes(nodes_df=None, edges_df=None)#
Extract schema from pandas DataFrames.
- Args:
nodes_df: Optional node dataframe edges_df: Optional edge dataframe
- Returns:
Schema object with column names and types
- Parameters:
nodes_df (DataFrame | None)
edges_df (DataFrame | None)
- Return type:
- graphistry.compute.gfql.validate.format_validation_errors(issues)#
Format validation errors for human/LLM consumption.
- Args:
issues: List of validation issues
- Returns:
Formatted error string
- Parameters:
issues (List[ValidationIssue])
- Return type:
str
- graphistry.compute.gfql.validate.suggest_fixes(chain, issues)#
Generate fix suggestions for validation issues.
- Args:
chain: The problematic chain issues: Validation issues found
- Returns:
List of suggested fixes
- Parameters:
chain (Chain | List)
issues (List[ValidationIssue])
- Return type:
List[str]
- graphistry.compute.gfql.validate.validate_query(chain, nodes_df=None, edges_df=None)#
Combined syntax and schema validation.
- Args:
chain: GFQL chain or list of operations nodes_df: Optional node dataframe for schema validation edges_df: Optional edge dataframe for schema validation
- Returns:
List of validation issues
- Parameters:
chain (Chain | List)
nodes_df (DataFrame | None)
edges_df (DataFrame | None)
- Return type:
List[ValidationIssue]
- graphistry.compute.gfql.validate.validate_schema(chain, schema)#
Validate query against data schema.
- Args:
chain: GFQL chain or list of operations schema: Schema object with column information
- Returns:
List of validation issues
- Parameters:
- Return type:
List[ValidationIssue]
- graphistry.compute.gfql.validate.validate_syntax(chain)#
Validate GFQL query syntax without requiring data.
- Args:
chain: GFQL chain or list of operations
- Returns:
List of validation issues (errors and warnings)
- Parameters:
chain (Chain | List)
- Return type:
List[ValidationIssue]