Comments (5)
I understand the issue is caused by the lack of installation of dbt-snowflake
. sqlfluff-template-dbt
tried to use a dbt profile based on the configuration, but dbt-snowflake
can't be found.
The issue probably haapens on any dbt adapter with dbt-core>=1.0.0
. I will think of a way to install extra required packages for dbt adapters.
from action-sqlfluff.
@dweaver33 Thank you for the feedback. I will look into it.
from action-sqlfluff.
I get a similar error with dbt-bigquery:
=== [dbt templater] Sorting Nodes...
10:49:34 Error importing adapter: No module named 'dbt.adapters.bigquery'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dbt/config/profile.py", line 183, in _credentials_from_profile
cls = load_plugin(typename)
File "/usr/local/lib/python3.9/site-packages/dbt/adapters/factory.py", line 215, in load_plugin
return FACTORY.load_plugin(name)
File "/usr/local/lib/python3.9/site-packages/dbt/adapters/factory.py", line 70, in load_plugin
raise RuntimeException(f'Could not find adapter type {name}!')
dbt.exceptions.RuntimeException: Runtime Error
Could not find adapter type bigquery!
from action-sqlfluff.
@dweaver33 @adeoluwaakande
I added a new action's input extra_requirements_txt
to install your dbt adapters. As you can imagine, conflicts can occur, if the extra requirements.txt
contains sqlfluff
and its dependent modules. So, I would recommend you put only dbt adapter you use into it. The changes were released at v3.2.0. Please feel free to give me any feedback on it.
from action-sqlfluff.
@yu-iskw
Thanks for the fix. However, I get now get a parse error: Invalid numeric literal at line 1, column 5
when I run the following setup:
- uses: yu-iskw/action-sqlfluff@v3
if: steps.check.outputs.triggered == 'true'
id: lint-sql
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
sqlfluff_version: "0.11.1"
sqlfluff_command: "lint" # Or "fix"
config: "${{ github.workspace }}/.sqlfluff"
paths: '${{ github.workspace }}/src/dbt/models'
extra_requirements_txt: '${{ github.workspace }}/sqlfluff_requirements.txt'
It has been difficult for me to identify the file the error refers to. The full error is:
Running sqlfluff 🐶 ...
==== readout ====
07:49:46 Partial parse save file not found. Starting full parse.
Traceback (most recent call last):
File "/usr/local/bin/sqlfluff", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/sqlfluff/cli/commands.py", line 533, in lint
result = lnt.lint_paths(
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/linter.py", line 1087, in lint_paths
self.lint_path(
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/linter.py", line 1039, in lint_path
for i, linted_file in enumerate(runner.run(fnames, fix), start=1):
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/runner.py", line 137, in run
for lint_result in self._map(
File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 870, in next
raise value
File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 144, in _helper_reraises_exception
raise ex
File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 388, in _guarded_task_generation
for i, x in enumerate(iterable):
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/runner.py", line 54, in iter_partials
for fname, rendered in self.iter_rendered(fnames):
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/runner.py", line 43, in iter_rendered
yield fname, self.linter.render_file(fname, self.config)
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/linter.py", line 760, in render_file
return self.render_string(raw_file, fname, config, encoding)
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/linter/linter.py", line 731, in render_string
templated_file, templater_violations = self.templater.process(
File "/usr/local/lib/python3.9/site-packages/sqlfluff_templater_dbt/templater.py", line 323, in process
processed_result = self._unsafe_process(fname_absolute_path, in_str, config)
File "/usr/local/lib/python3.9/site-packages/sqlfluff_templater_dbt/templater.py", line 541, in _unsafe_process
TemplatedFile(
File "/usr/local/lib/python3.9/site-packages/sqlfluff/core/templaters/base.py", line 129, in __init__
assert (
AssertionError
parse error: Invalid numeric literal at line 1, column 5
Running reviewdog 🐶 ...
parse error: Invalid numeric literal at line 1, column 5
reviewdog: parse error: failed to unmarshal rdjson (DiagnosticResult): proto: syntax error (line 1:1): unexpected token
Do you have an idea of how to fix this?
from action-sqlfluff.
Related Issues (20)
- Wrong JSON output with tee and dbt templater HOT 1
- SQLFluff parse error in lint mode HOT 3
- SqlFluff action causes Deprecation Warning on GitHub HOT 1
- Current version of sqlfluff is 1.4.5 HOT 2
- reviewdog outputs raw format instead of code suggestion HOT 1
- I get an error for my github action even after I fix all the linting issues HOT 1
- Enhancement: enable --show-lint-violations for sqlfluff fix HOT 1
- SQLFluff failing due to ImportError HOT 4
- SQLFluff failing due to ModuleNotFoundError: No module named 'pytz' HOT 4
- Action doesn't pick up space in paths HOT 3
- fatal: --unshallow on a complete repository does not make sense HOT 4
- SQLFluff not leaving comments on GitHub Pull Requests on lint mode HOT 1
- sqlfluff v2.0 HOT 2
- action-sqlfluff GH action outputs raw format instead of inline code suggestion HOT 1
- Alternate working directory configuration not respected (dbt_project.yml) HOT 4
- Security Policy violation Branch Protection HOT 2
- Security Policy violation SECURITY.md HOT 149
- SQLFluff linting job failing due to missing CompilationException from dbt.exceptions HOT 1
- "Show output - optional" step shows empty results
- (conclusion=failure)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-sqlfluff.