-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
SyntaxError: Unexpected token : in JSON at position 2 #15
Comments
Sorry but what has SQLFluff got to do with |
hmmm well it's used together with If you run this Github Action as it's described here: https://github.com/sqlfluff/sqlfluff-github-actions/blob/main/menu_of_workflows/drizly/lint_sqlfluff.yml it's going to fail with the SQLFluff 0.9.0. |
Ah apologies. Missed this was in the sqlfluff-github-actions repo, rather than the main one. Still, I'm not aware of any changes in this space and running the following:
Produces valid JSON. Can you see what the differences is in the JSON produced by SQLFluff 0.9.0 and the previous version by running above command on your SQL? |
@tunetheweb In the docs it recommends using the yuzutech action and there's a flag in the CLI that outputs the results in "github-annotation" format, which is some special JSON format for this yuzutech action not a general Github one. I dislike that that we're tied to using this yuzutech action for Github annotations. ^I'll pull together a POC on this |
"recommends" is strong IMHO. My understanding is this is a collection of GitHub Actions that SQLFluff users have implemented more as a showcase of what can be done, than something we will necessarily provide support on — especially when it involves other third-party actions we have no control over. I also think we should update the README of this repo to reflect that. And while I agree the yuzutech action may be over kill here, I'm still curious as to what's changed in SQLFluff 0.9.0 to cause this issue. The fact that even empty JSON causes this error suggests the issue is with the yuzutech action but weird that it's coupled to SQLFluff 0.9.0. Either way need more info from OP to make any progress here. |
Also no need to be so defensive, I can close the issue if you sleep better that way |
Apologies again for the curtness of my initial response @tlfbrito . As I say I made a mistake and failed to notice this was in the SQLFluff actions repo. Saying that, as per above, I still do not believe there is enough info in the original request to investigate further. |
@tlfbrito let's keep this issue focussed... As @tunetheweb was hinting, can you provide:
thanks 😄 |
@tunetheweb as a takeaway could we look at adding issue templates to the other SQLFluff org repos similar to what we have in the main one? Happy to help with some of these |
Re: the "recommends" point, it's referenced directly in the main docs here and as I said the (I'll make a separate issue for discussing the recommended approach though) |
How many times can I be wrong in the one issue 😞 Still, on the plus side, 2021 is nearly at an end! 😀 |
It seems that the file it's contains "15:03:10 Partial parse save file not found. Starting full parse.", this only happen with the 0.9.0 version of |
That looks to be a DBT error: dbt-labs/dbt-core#3886 Also searched and can't find it in our code base. Is there anyway to configure DBT so as not so add this (I don't use DBT)? |
yeah in that case it sounds like a fatal dbt error rather than anything to do with annotations. Surely the same thing would happen if you just ran the |
I'm now also be experiencing the same issue and I'm pretty sure sqlfluff is causing it - or at least it's implementation of the dbt templater. Currently having difficulty recreating it outside of the environment of the github action - but I'm working on a failing test case to demonstrate the issue. |
Ok, I think I've got a workaround and a diagnosis. @tunetheweb is right that the command isn't being emitted by SQLFluff directly. SQLFluff uses dbt under the hood, which is outputting to stdout directly itself (see dbt functions.py). Because we run To make things more unhelpful, dbt is using a logger called I'm going to lodge an issue with dbt asking how we can suppress their log output. In the meantime, I've got a workaround (@tlfbrito) which is working on our project:
|
As an update, the dbt team are working on dbt-labs/dbt-core#3451, which should provide us with a solution to this problem. |
If anyone is watching this one - there's an alternative solution in progress here: #5070 |
After updating to sqlfluff
0.9.0
theyuzutech/annotations-action
started to fail withError: SyntaxError: Unexpected token : in JSON at position 2
This even happens when the annotation contains an empty json (
[]
).The text was updated successfully, but these errors were encountered: