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

Unexpected exception: 'NoneType' object has no attribute 'source_fixes'; #5878

Open
1 task done
dogversioning opened this issue May 13, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@dogversioning
Copy link
Contributor

Search before asking

  • I searched the issues and found no similar issues.

What Happened

When linting, i received the following error:

L:   1 | P:   1 | JJ01 | Unexpected exception: 'NoneType' object has no attribute
                       | 'source_fixes';
Could you open an issue at
                       | https://github.com/sqlfluff/sqlfluff/issues ?
You can
                       | ignore this exception for now, by adding '-- noqa: JJ01'
                       | at the end
of line 1

Expected Behaviour

The whitespace error to be reported as normal.

Observed Behaviour

This looks to me like it is an error parsing missing whitespace at the end of a chained set of functions inside double brackets, after a comment block, inside a jinja template

How to reproduce

The error occurs with this edited down jinja template:


{%- macro wildcard_to_regex(match_string) -%}
{{ match_string.replace('/', '\/').replace('.', '\.').replace('%', '(.*)')}}
{%- endmacro -%}```

### Dialect

athena

### Version

3.0.5

### Configuration

[sqlfluff]
templater = jinja
dialect = athena
sql_file_exts = .sql,.sql.jinja

max_line_length = 90

[sqlfluff:indentation]
template_blocks_indent = false

[sqlfluff:rules:layout.long_lines]
ignore_comment_lines = true

[sqlfluff:rules:capitalisation.keywords]
capitalisation_policy = upper


### Are you willing to work on and submit a PR to address the issue?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)
@dogversioning dogversioning added the bug Something isn't working label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant