Skip to content
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

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

Open
lmeyerov opened this issue Feb 8, 2025 · 0 comments
Open

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

lmeyerov opened this issue Feb 8, 2025 · 0 comments

Comments

@lmeyerov
Copy link
Contributor

lmeyerov commented Feb 8, 2025

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant