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

Compile select with functions like has, hasAny, hasAll #205

Closed
SomeAkk opened this issue Oct 18, 2022 · 3 comments
Closed

Compile select with functions like has, hasAny, hasAll #205

SomeAkk opened this issue Oct 18, 2022 · 3 comments

Comments

@SomeAkk
Copy link

SomeAkk commented Oct 18, 2022

Describe the bug
Looks like there is no visitors for clickhouse functions like has, hasAny, hasAll. Current visitor for func which made in sqlalchemy standart visitors can't parse arguments in functions like has, hasAny, hasAll (do not see arrays in it).

To Reproduce
Create table with array field, write select query with sa and, for example hasAny, function:

select.where(func.hasAny(awesome_array_field,["kek", "puk"])

Compile query like:

print(q.statement.compile(compile_kwargs={"literal_binds": True}))

Get

    def process(value):
>       raise exc.CompileError(
            "Don't know how to render literal SQL value: %r" % (value,)
        )
E       sqlalchemy.exc.CompileError: Don't know how to render literal SQL value: ['kek', 'puk']

Expected behavior
Query compiles without exceptions.

Versions

  • 0.2.2
  • 3.9
xzkostyan added a commit that referenced this issue Oct 22, 2022
@xzkostyan
Copy link
Owner

Fixed in latest master.

@SomeAkk
Copy link
Author

SomeAkk commented Oct 24, 2022

Fixed in latest master.

does it need version bump?

@xzkostyan
Copy link
Owner

Version 0.2.3 released.

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

No branches or pull requests

2 participants