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

vsdql related errors on load and & #2399

Open
reagle opened this issue May 2, 2024 · 0 comments
Open

vsdql related errors on load and & #2399

reagle opened this issue May 2, 2024 · 0 comments

Comments

@reagle
Copy link

reagle commented May 2, 2024

I was trying to run a simple vsdql example, but ran into some problems; not sure what they mean -- and I can work with the file okay without -f vdsql.

  • macOS 14.4.1 23E224 arm64
  • saul.pw/VisiData v3.0.2
wget https://www.sqlitetutorial.net/wp-content/uploads/2018/03/chinook.zip
unzip chinook.zip
vd -f vdsql chinook.db

On load:

Traceback (most recent call last):
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sqlite/__init__.py", line 168, in _parse_type
out = self._type_map[typ]
~~~~~~~~~~~~~~^^^^^
KeyError: 'datetime'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/threads.py", line 220, in _toplevelTryFunc
t.status = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/sheets.py", line 260, in reload
self.loader()
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/sheets.py", line 285, in loader
for r in self.iterload():
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/vdsql/ibis.py", line 67, in iterload
tbl = self.tbl = con.table(tblname)
^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sql/__init__.py", line 137, in table
table_schema = self.get_schema(name, catalog=catalog, database=database)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sqlite/__init__.py", line 240, in get_schema
return self._inspect_schema(cur, table_name, database)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sqlite/__init__.py", line 207, in _inspect_schema
name: self._parse_type(typ, nullable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sqlite/__init__.py", line 170, in _parse_type
return self.compiler.type_mapper.from_string(typ, nullable=nullable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sql/datatypes.py", line 196, in from_string
return cls.to_ibis(sgtype, nullable=nullable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/backends/sql/datatypes.py", line 174, in to_ibis
dtype = _from_sqlglot_types[typecode](nullable=cls.default_nullable)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: <Type.DATETIME: 'DATETIME'>

Ignoring, and trying to merge albums and artists:

Traceback (most recent call last):
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/vdsql/ibis.py", line 256, in get_ibis_col
r = query.get_column(col.ibis_name)
^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/expr/types/relations.py", line 844, in __getattr__
raise AttributeError(f"'Table' object has no attribute {key!r}")
AttributeError: 'Table' object has no attribute 'get_column'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/basesheet.py", line 211, in execCommand
escaped = super().execCommand2(cmd, vdglobals=vdglobals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/extensible.py", line 79, in wrappedfunc
r = oldfunc(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/basesheet.py", line 76, in execCommand2
exec(code, vdglobals, LazyChainMap(vd, self))
File "join-selected", line 1, in <module>
'VisiData: a curses interface for exploring and arranging tabular data'
^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/vdsql/ibis.py", line 235, in openJoin
preds = [(a.ibis_col == b.ibis_col) for a, b in zip(self.keyCols, other.keyCols)]
^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/visidata/extensible.py", line 108, in dofunc
return func(self)
^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/vdsql/ibis.py", line 243, in ibis_col
return col.get_ibis_col(col.sheet.query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/vdsql/ibis.py", line 258, in get_ibis_col
r = query.get_column(col.name)
^^^^^^^^^^^^^^^^
File "/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ibis/expr/types/relations.py", line 844, in __getattr__
raise AttributeError(f"'Table' object has no attribute {key!r}")
AttributeError: 'Table' object has no attribute 'get_column'
@reagle reagle added the bug label May 2, 2024
@reagle reagle changed the title vsdql related errors vsdql related errors on load and & May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants