tuple index out of range (sqlfluff) - python

I am using python 3.9.1 and have 0.3.6 sqlfluff. I do lint some files successfully and fix them however I am trying to lint 757 rows of sql file and it is giving me this error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/sqlfluff", line 8, in <module>
sys.exit(cli())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/cli/commands.py", line 172, in lint
result = lnt.lint_paths(paths, verbosity=verbose, ignore_non_existent_files=False)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/linter.py", line 911, in lint_paths
result.add(self.lint_path(path, verbosity=verbosity, fix=fix,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/linter.py", line 896, in lint_path
self.lint_string(target_file.read(), fname=fname,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/linter.py", line 748, in lint_string
lerrs, _, _, _ = crawler.crawl(parsed, dialect=config.get('dialect_obj'))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/rules/base.py", line 268, in crawl
dvs, raw_stack, child_fixes, memory = self.crawl(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/rules/base.py", line 233, in crawl
res = self._eval(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/rules/std.py", line 53, in _eval
if raw_stack[idx].type == 'whitespace':
IndexError: tuple index out of range
github issue

Related

odoo v11 converter does not exist

all modules has been installed correctly since I restored it from a working backup.
the problem is, it doesn't read properly. does anyone know how to fix this?
2022-02-15 02:40:22,799 31154 ERROR tester werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 205, in run_wsgi
execute(self.server.app)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 193, in execute
application_iter = app(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/service/server.py", line 292, in app
return self.app(e, s)
File "/home/ria/olive/tigernixerp11/odoo/service/wsgi_server.py", line 166, in application
return application_unproxied(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/service/wsgi_server.py", line 154, in application_unproxied
result = handler(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 1321, in __call__
return self.dispatch(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 1295, in __call__
return self.app(environ, start_wrapped)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/wsgi.py", line 599, in __call__
return self.app(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 1510, in dispatch
result = ir_http._dispatch()
File "/home/ria/olive/tigernixerp11/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
return super(Http, cls)._dispatch()
File "/home/ria/olive/tigernixerp11/addons/web_editor/models/ir_http.py", line 22, in _dispatch
return super(IrHttp, cls)._dispatch()
File "/home/ria/olive/tigernixerp11/addons/http_routing/models/ir_http.py", line 322, in _dispatch
rule, arguments = cls._find_handler(return_rule=True)
File "/home/ria/olive/tigernixerp11/odoo/addons/base/ir/ir_http.py", line 84, in _find_handler
return cls.routing_map().bind_to_environ(request.httprequest.environ).match(return_rule=return_rule)
File "/home/ria/olive/tigernixerp11/odoo/addons/base/ir/ir_http.py", line 238, in routing_map
cls._routing_map = http.routing_map(mods, False, converters=cls._get_converters())
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 988, in routing_map
routing_map.add(werkzeug.routing.Rule(url, endpoint=endpoint, methods=routing['methods'], **kw))
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 1197, in add
rule.bind(self)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 681, in bind
self.compile()
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 731, in compile
_build_regex(self.is_leaf and self.rule or self.rule.rstrip('/'))
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 721, in _build_regex
variable, converter, c_args, c_kwargs)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 689, in get_converter
raise LookupError('the converter %r does not exist' % converter_name)
LookupError: the converter 'str' does not exist
restoring in another computer doesn't seem to have any problem butthis computer seems to be unable to read properly

Python 3.9 Errors with MKDocs Serve

After upgrading to Python 3.9, i'm getting these errors when running mkdocs serve I'm not a developer. I use MKDocs to build a documentation site and I wanted to upgrade the software, as a result I had to upgrade Python, pip, mkdocs and mkdocs-material..
INFO - Cleaning site directory
Traceback (most recent call last):
File "/usr/local/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/mkdocs/__main__.py", line 133, in serve_command
serve.serve(
File "/usr/local/lib/python3.9/site-packages/mkdocs/commands/serve.py", line 141, in serve
config = builder()
File "/usr/local/lib/python3.9/site-packages/mkdocs/commands/serve.py", line 136, in builder
build(config, live_server=live_server, dirty=dirty)
File "/usr/local/lib/python3.9/site-packages/mkdocs/commands/build.py", line 263, in build
nav = get_navigation(files, config)
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/nav.py", line 102, in get_navigation
items = _data_to_navigation(nav_config, files, config)
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/nav.py", line 157, in _data_to_navigation
return [
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/nav.py", line 158, in <listcomp>
_data_to_navigation(item, files, config)[0]
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/nav.py", line 150, in _data_to_navigation
return [
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/nav.py", line 153, in <listcomp>
Section(title=key, children=_data_to_navigation(value, files, config))
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/nav.py", line 164, in _data_to_navigation
file = files.get_file_from_path(path)
File "/usr/local/lib/python3.9/site-packages/mkdocs/structure/files.py", line 31, in get_file_from_path
return self.src_paths.get(os.path.normpath(path))
File "/usr/local/Cellar/python#3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/posixpath.py", line 336, in normpath
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType```
Try this.
pip install -U mkdocs
I was getting same error. After updated mkdocs it resolved.

Theano error while fitting a PyMC3 model in parallel - No module named 'tmpttugnbtl'

I'm fitting an identical PyMC3 model to different datasets in parallel using joblib and the multiprocessing module and I'm running into a strange error.
Although the model fits fine for the vast majority of the datasets, it fails for a random subset, here's the error message:
Traceback (most recent call last):
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py", line 418, in _process_worker
r = call_item()
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py", line 272, in __call__
return self.fn(*self.args, **self.kwargs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 567, in __call__
return self.func(*args, **kwargs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in __call__
for func, args, kwargs in self.items]
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in <listcomp>
for func, args, kwargs in self.items]
File "fit_ogle3_2002.py", line 80, in fit_event
pspl_model, alert_time = initialize_model(event)
File "/gpfs1/home/fb90/hierarchical/fit_albrow/model.py", line 88, in initialize_model
mean = f*F_base*mag + (1 - f)*F_base
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/tensor/var.py", line 155, in __mul__
return theano.tensor.mul(self, other)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 670, in __call__
no_recycling=[])
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 955, in make_thunk
no_recycling)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 858, in make_c_thunk
output_storage=node_output_storage)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1217, in make_thunk
keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1157, in __compile__
keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1624, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 1148, in module_from_key
module = self._get_from_key(key)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 1047, in _get_from_key
return self._get_module(name)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 720, in _get_module
self.module_from_name[name] = dlimport(name)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 317, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ModuleNotFoundError: No module named 'tmpttugnbtl'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "fit_ogle3_2002.py", line 153, in <module>
result = Parallel(n_jobs)(delayed(fit_event)(directory) for directory in dirs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 934, in __call__
self.retrieve()
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 833, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 521, in wrap_future_result
return future.result(timeout=timeout)
File "/home/fb90/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/home/fb90/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
ModuleNotFoundError: No module named 'tmpttugnbtl'
What exactly is No module named 'tmpttugnbtl' supposed to mean :S?
I'm using version 3.7 of PyMC3 and version 1.0.4 of Theano. The code is paralellized using the following lines
from joblib import Parallel, delayed
import multiprocessing
n_jobs = 32
result = Parallel(n_jobs)(delayed(fit_event)(directory) for directory in dirs)

PyDEM LoweringError: slc0.8

I'm in Win7 64, Anaconda Python installation, pip installed PyDEM.
I'm getting an error when calling .calc_slopes_directions() on a DEMProcessor instance (see below).
I'm aware of this question; that seems not to be the same problem I have.
This LoweringError: slc0.8 seems to be related to Numba.
This is the code I enter and the error I get:
from pydem.dem_processing import DEMProcessor
os.chdir(r'D:\my_path')
a_tile = r'31an2_clipped_wgs84.tif'
dem_proc = DEMProcessor(a_tile)
mag, aspect = dem_proc.calc_slopes_directions()
starting slope/direction calculation for chunk 1 [0:516, 0:516]
Traceback (most recent call last):
File "<ipython-input-13-6dc0db5771d2>", line 1, in <module>
mag, aspect = dem_proc.calc_slopes_directions()
File "C:\Program Files\Anaconda2\lib\site-packages\pydem\dem_processing.py", line 853, in calc_slopes_directions
self.dY[te:be-1])
File "C:\Program Files\Anaconda2\lib\site-packages\pydem\dem_processing.py", line 879, in _slopes_directions
return self._tarboton_slopes_directions(data, dX, dY)
File "C:\Program Files\Anaconda2\lib\site-packages\pydem\dem_processing.py", line 890, in _tarboton_slopes_directions
self.facets, self.ang_adj)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\dispatcher.py", line 285, in _compile_for_args
return self.compile(tuple(argtypes))
File "C:\Program Files\Anaconda2\lib\site-packages\numba\dispatcher.py", line 531, in compile
cres = self._compiler.compile(args, return_type)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\dispatcher.py", line 80, in compile
flags=flags, locals=self.locals)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 725, in compile_extra
return pipeline.compile_extra(func)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 369, in compile_extra
return self.compile_bytecode(bc, func_attr=self.func_attr)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 378, in compile_bytecode
return self._compile_bytecode()
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 690, in _compile_bytecode
return self._compile_core()
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 677, in _compile_core
res = pm.run(self.status)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 257, in run
raise patched_exception
LoweringError: slc0.8

Running Pyramid app in Jython + pserve (waitress)

I installed Pyramid, SQLAlchemy and waitress running in virtualenv on Jython 2.7 (platform: Linux x64). Unfortunately pserve cannot start:
% pserve development.ini
Traceback (most recent call last):
File "/myapp/j1/ve/bin/pserve", line 11, in <module>
sys.exit(main())
File "/myapp/j1/ve/Lib/site-packages/pyramid/scripts/pserve.py", line 60, in main
return command.run()
File "/myapp/j1/ve/Lib/site-packages/pyramid/scripts/pserve.py", line 367, in run
server = self.loadserver(server_spec, name=server_name,
File "/myapp/j1/ve/Lib/site-packages/pyramid/scripts/pserve.py", line 409, in loadserver
return loadserver(
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 255, in loadserver
return loadobj(SERVER, uri, name=name, **kw)
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 269, in loadobj
context = loadcontext(
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 293, in loadcontext
return _loaders[scheme](
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
return loader.get_context(object_type, name, global_conf)
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 452, in get_context
context = self._context_from_use(
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 475, in _context_from_use
context = self.get_context(
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 404, in get_context
return loadcontext(object_type, name,
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 293, in loadcontext
return _loaders[scheme](
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
return loader.get_context(object_type, name, global_conf)
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 619, in get_context
entry_point, protocol, ep_name = self.find_egg_entry_point(
File "/myapp/j1/ve/Lib/site-packages/paste/deploy/loadwsgi.py", line 646, in find_egg_entry_point
possible.append((entry.load(), protocol, entry.name))
File "/myapp/j1/ve/Lib/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/myapp/j1/ve/Lib/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/myapp/j1/ve/Lib/site-packages/waitress/__init__.py", line 1, in <module>
from waitress.server import create_server
File "/myapp/j1/ve/Lib/site-packages/waitress/server.py", line 22, in <module>
from waitress.adjustments import Adjustments
File "/myapp/j1/ve/Lib/site-packages/waitress/adjustments.py", line 47, in <module>
class Adjustments(object):
File "/myapp/j1/ve/Lib/site-packages/waitress/adjustments.py", line 167, in Adjustments
socket_options = [
AttributeError: 'module' object has no attribute 'SOL_TCP'
Is there some workaround for this?

Categories