You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying my first pipeline with ampy-jupyterlab. I connected a parquet file reader with a postgres database. The file is read, but the postgres output produces:
Error
Class directly inherits TypingOnly but has additional attributes {'__firstlineno__', '__static_attributes__'}.
Show Traceback
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In[7], line 3
1 get_ipython().system('pip install --quiet psycopg2-binary --disable-pip-version-check')
2 import pandas as pd
----> 3 import sqlalchemy
4 import psycopg2
5 # No environment variable components found.
6 # No connection components found.
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/__init__.py:13
10 from typing import Any
12 from . import util as _util
---> 13 from .engine import AdaptedConnection as AdaptedConnection
14 from .engine import BaseRow as BaseRow
15 from .engine import BindTyping as BindTyping
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/engine/__init__.py:18
1 # engine/__init__.py
2 # Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
3 # <see AUTHORS file>
4 #
5 # This module is part of SQLAlchemy and is released under
6 # the MIT License: https://www.opensource.org/licenses/mit-license.php
8 """SQL connections, SQL execution and high-level DB-API interface.
9
10 The engine package defines the basic components used to interface
(...)
15
16 """
---> 18 from . import events as events
19 from . import util as util
20 from .base import Connection as Connection
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/engine/events.py:19
16 from typing import Type
17 from typing import Union
---> 19 from .base import Connection
20 from .base import Engine
21 from .interfaces import ConnectionEventsTarget
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/engine/base.py:30
27 from typing import TypeVar
28 from typing import Union
---> 30 from .interfaces import BindTyping
31 from .interfaces import ConnectionEventsTarget
32 from .interfaces import DBAPICursor
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/engine/interfaces.py:38
36 from ..pool import Pool
37 from ..pool import PoolProxiedConnection
---> 38 from ..sql.compiler import Compiled as Compiled
39 from ..sql.compiler import Compiled # noqa
40 from ..sql.compiler import TypeCompiler as TypeCompiler
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/__init__.py:11
8 from typing import TYPE_CHECKING
10 from .base import Executable as Executable
---> 11 from .compiler import COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS
12 from .compiler import FROM_LINTING as FROM_LINTING
13 from .compiler import NO_LINTING as NO_LINTING
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/compiler.py:60
58 from . import base
59 from . import coercions
---> 60 from . import crud
61 from . import elements
62 from . import functions
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/crud.py:34
31 from typing import Union
33 from . import coercions
---> 34 from . import dml
35 from . import elements
36 from . import roles
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/dml.py:34
32 from . import coercions
33 from . import roles
---> 34 from . import util as sql_util
35 from ._typing import _no_kw
36 from ._typing import _TP
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/util.py:46
44 from .base import _from_objects
45 from .cache_key import HasCacheKey as HasCacheKey # noqa: F401
---> 46 from .ddl import sort_tables as sort_tables # noqa: F401
47 from .elements import _find_columns as _find_columns
48 from .elements import _label_reference
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:30
28 from .base import Executable
29 from .base import SchemaVisitor
---> 30 from .elements import ClauseElement
31 from .. import exc
32 from .. import util
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:755
749 _propagate_attrs = util.EMPTY_DICT
752 # SQLCoreOperations should be suiting the ExpressionElementRole
753 # and ColumnsClauseRole. however the MRO issues become too elaborate
754 # at the moment.
--> 755 class SQLCoreOperations(Generic[_T], ColumnOperators, TypingOnly):
756 __slots__ = ()
758 # annotations for comparison methods
759 # these are from operators->Operators / ColumnOperators,
760 # redefined with the specific types returned by ColumnElement hierarchies
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/typing.py:1257, in _generic_init_subclass(cls, *args, **kwargs)
1256 def _generic_init_subclass(cls, *args, **kwargs):
-> 1257 super(Generic, cls).__init_subclass__(*args, **kwargs)
1258 tvars = []
1259 if '__orig_bases__' in cls.__dict__:
File /data/home/sdrwacker/miniforge3/envs/jupyter/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py:1983, in TypingOnly.__init_subclass__(cls)
1973 remaining = set(cls.__dict__).difference(
1974 {
1975 "__module__",
(...)
1980 }
1981 )
1982 if remaining:
-> 1983 raise AssertionError(
1984 f"Class {cls} directly inherits TypingOnly but has "
1985 f"additional attributes {remaining}."
1986 )
1987 super().__init_subclass__()
AssertionError: Class <class 'sqlalchemy.sql.elements.SQLCoreOperations'> directly inherits TypingOnly but has additional attributes {'__firstlineno__', '__static_attributes__'}.
Does this mean I am using the wrong version of sqlalchemy?
The text was updated successfully, but these errors were encountered:
Hi @sorenwacker, this seems like a Python version incompatibility between your Python version 3.13 and the sqlalchemy version. Haven't found similar issues online yet. what you could try is upgrade sqlalchemy manually using this command in your Python environment to see if that helps. Will try to look at this issue for next release pip install --upgrade sqlalchemy
I am trying my first pipeline with ampy-jupyterlab. I connected a parquet file reader with a postgres database. The file is read, but the postgres output produces:
Does this mean I am using the wrong version of sqlalchemy?
The text was updated successfully, but these errors were encountered: