Skip to content

[FEA] GFQL constant-valued predicate type checking #650

@lmeyerov

Description

@lmeyerov

Is your feature request related to a problem? Please describe.

We had an error where the user ran chain

[n({'n': '0'}), e_forward(), n()]

And got not hits, b/c it was a type error, should have been:

[n({node_id: 0}), e_forward(), n()]

This could have warned or raised ahead of time with a clear message

Describe the solution you'd like

This query does not type check --- '0' : str will never match g._nodes.n.dtype.name == 'int64'

So a few things:

  • g.chain(): By default, we can run & raise constant predictate type mismatches
  • g.chain_remote(): Return a client error (422) on errors here
  • Add optional arg validation='skip'|'warn'|'error'

Describe alternatives you've considered

I was trying to think of a way we can do python-typed predicate functions, not just primitve value checking, but was not clear

We should probably also support both pandas 1 (obj = str or obj) and pandas 2 (str dtype)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions