pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

[FEA] `eq` should also take `str` type

Open morristai opened this issue 4 weeks ago • 2 comments

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

If we use eq matcher like this:

eq("string")

it will show error: Expected type 'int | float | number[Any, int | float | complex] | Timestamp | datetime | date | time | DateTimeWire | DateWire | TimeWire | TemporalValue', got 'str' instead .
As eq doesn't allow str type.

So if the value we're comparing to is a str, we will have to use

source_node_match={
  "x": "a",
  "y": is_in([1,2]),
  "z": gt(3)
}

It misses the predicate term and is misaligned with the non-str conditions.

Describe the solution you'd like

Be able to call "x": eq("a").

morristai avatar Dec 02 '25 22:12 morristai

Ah that makes sense -- so "x": "b" is sugar that we turn into "x": eq("a"), and add more type polymorphism to eq()

Just double checking: did you encounter this with the query/schema validators missing the polymorphism, or the actual runtime execution?

lmeyerov avatar Dec 02 '25 22:12 lmeyerov

query/schema validators missing the polymorphism

query/schema validators missing the polymorphism, I threw a str into a eq matcher and got this error.

morristai avatar Dec 03 '25 03:12 morristai