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

validate() missing 1 required positional argument: 'known_fields' #39

Open
timotta opened this issue Mar 23, 2022 · 3 comments
Open

validate() missing 1 required positional argument: 'known_fields' #39

timotta opened this issue Mar 23, 2022 · 3 comments

Comments

@timotta
Copy link

timotta commented Mar 23, 2022

Using python 3.9 and sqlvalidator==0.0.18

When running sqlvalidator.parse(query).is_valid() i'm getting

    def _validate(self):
        self.validated = True
        try:
>           self.errors = self.sql_query.validate()
E           TypeError: validate() missing 1 required positional argument: 'known_fields'

The class of self.sql_query is WithStatement

@David-Wobrock
Copy link
Owner

Hey @timotta

Thanks for opening an issue.

What's the content of the query variable? :) So that I can reproduce the issue

@vchauhan-ai
Copy link

I am getting similar issue. When I am validating the query using WITH to create an alias, then it is giving this error

@MilesMartinez
Copy link

MilesMartinez commented Feb 14, 2023

I get this error when attempting to use WITH AS as well.

Example

with cte as (select * from a)
select * from cte

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

4 participants