graphistry.models.gfql.types package#

Submodules#

graphistry.models.gfql.types.guards module#

Type detection utilities

Clear functions to check what kind of type a value is.

graphistry.models.gfql.types.guards.is_any_numeric(val)#

Check if value is any kind of numeric (currently same as native)

Parameters:

val (Any)

Return type:

bool

graphistry.models.gfql.types.guards.is_any_temporal(val)#

Check if value is any kind of temporal (native, AST, or wire)

Parameters:

val (Any)

Return type:

TypeGuard[Union[NativeTemporal, TemporalValue, TemporalWire]]

graphistry.models.gfql.types.guards.is_ast_temporal(val)#

Check if value is an AST TemporalValue

Parameters:

val (Any)

Return type:

TypeGuard[TemporalValue]

graphistry.models.gfql.types.guards.is_basic_scalar(val)#

Check if value is a basic scalar (int, float, str, None)

Parameters:

val (Any)

Return type:

TypeGuard[Union[int, float, str, np.number, None]]

graphistry.models.gfql.types.guards.is_dict(val)#

Check if value is a dictionary

Parameters:

val (Any)

Return type:

bool

graphistry.models.gfql.types.guards.is_native_numeric(val)#

Check if value is a native numeric type

Parameters:

val (Any)

Return type:

TypeGuard[NativeNumeric]

graphistry.models.gfql.types.guards.is_native_temporal(val)#

Check if value is a native Python/Pandas temporal type

Parameters:

val (Any)

Return type:

TypeGuard[NativeTemporal]

graphistry.models.gfql.types.guards.is_none(val)#

Check if value is None

Parameters:

val (Any)

Return type:

bool

graphistry.models.gfql.types.guards.is_string(val)#

Check if value is a string

Parameters:

val (Any)

Return type:

TypeGuard[str]

graphistry.models.gfql.types.guards.is_tagged_dict(val)#

Check if value is a tagged dictionary (has ‘type’ field)

Parameters:

val (Any)

Return type:

bool

graphistry.models.gfql.types.guards.is_wire_temporal(val)#

Check if value is a wire format temporal (tagged dict)

Parameters:

val (Any)

Return type:

TypeGuard[TemporalWire]

graphistry.models.gfql.types.numeric module#

Type definitions for numeric values in GFQL

Numeric data representations: 1. Native types - Host language numeric types (int, float, numpy types) 2. AST types - For numeric predicates, native types are used directly 3. Wire types - JSON number format (no special encoding needed)

graphistry.models.gfql.types.predicates module#

Type definitions for GFQL predicate inputs

Defines what types users can pass to predicates. Implementation details (like what gets stored internally) belong in compute/predicates.

graphistry.models.gfql.types.temporal module#

Type definitions for temporal values in GFQL

Temporal data has three representations: 1. Native types - Host language types (Python datetime, pandas.Timestamp, etc.) 2. AST types - Domain model objects used in the query AST (TemporalValue classes) 3. Wire types - JSON serialization format for client/server communication

Conversion functions follow the pattern: to/from_native, to/from_wire, to/from_ast

class graphistry.models.gfql.types.temporal.DateTimeWire#

Bases: TypedDict

Wire format for datetime with timezone

timezone: str#
type: Literal['datetime']#
value: str#
class graphistry.models.gfql.types.temporal.DateWire#

Bases: TypedDict

Wire format for date only

type: Literal['date']#
value: str#
class graphistry.models.gfql.types.temporal.TimeWire#

Bases: TypedDict

Wire format for time only

type: Literal['time']#
value: str#

Module contents#