Skip to content

Question usage of .contains() #128

Open

Description

@tester22

Hi,

After the upgrade to version 0.4 the syntax field.contains("value") doesn't work when evaluating a json input.
Is this by design or do I need to change anything on my implementation?

The error I am getting is: Rule evaluation error: ('no such overload', <class 'AttributeError'>, ("'str' object has no attribute 'contains'",))

Activity

  1. x0day commented on Aug 7, 2025

    @x0day

    +1

  2. hakucodes commented on Aug 16, 2025

    @hakucodes

    The same question

  3. slott56 commented on Aug 30, 2025

    @slott56
    Collaborator

    This is a feature request, really.

  4. stefanvanburen commented on Oct 6, 2025

    @stefanvanburen
    Contributor

    @slott56 was this fixed by #126 / would it be valuable to cut a v0.4.1 with this fix?

  5. slott56 commented on Nov 5, 2025

    @slott56
    Collaborator

    Good idea!

  6. self-assigned this
    on Nov 5, 2025
  7. Quantum0uasar commented on May 27, 2026

    @Quantum0uasar
    Collaborator

    Checking in on this — is .contains() still not working in the current version? The CEL spec defines string.contains(string) as a standard macro (https://github.com/google/cel-spec/blob/master/doc/langdef.md#macros), so it should be supported.

    If this is still reproducible, happy to look at adding/fixing the .contains() method on the StringType wrapper in celtypes.py. Would also add a test to prevent regressions.

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions