RDFLib / rdflib-sqlalchemy

RDFLib store using SQLAlchemy dbapi as back-end
Other
145 stars 34 forks source link

0.5.3: pytest is failing in 11 units #101

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

There are some warnings as well.

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-sqlalchemy-0.5.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-sqlalchemy-0.5.3-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.2.2, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3, configfile: pytest.ini, testpaths: test collected 16 items / 4 skipped test/test_aggregate_graphs.py FF [ 12%] test/test_sqlalchemy.py ..FFFFFFF.F [ 81%] test/test_store_performance.py .F [ 93%] test/test_type_to_term_combination.py . [100%] ========================================================================================= FAILURES ========================================================================================== _____________________________________________________________________________ GraphAggregates1.testAggregateRaw _____________________________________________________________________________ self = def setUp(self): memStore = plugin.get('SQLAlchemy', Store)( identifier="rdflib_test", configuration=self.dburi) self.graph1 = Graph(memStore) self.graph2 = Graph(memStore) self.graph3 = Graph(memStore) for n3Str, graph in [(testGraph1N3, self.graph1), (testGraph2N3, self.graph2), (testGraph3N3, self.graph3)]: > graph.parse(StringIO(n3Str), format='n3') test/test_aggregate_graphs.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1330: in parse parser.parse(source, self, **args) /usr/lib/python3.8/site-packages/rdflib/plugins/parsers/notation3.py:1975: in parse conj_graph.namespace_manager = graph.namespace_manager /usr/lib/python3.8/site-packages/rdflib/graph.py:396: in namespace_manager self.__namespace_manager = NamespaceManager(self, self._bind_namespaces) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:428: in __init__ self.bind(prefix, ns) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:696: in bind bound_prefix = self.store.prefix(namespace) rdflib_sqlalchemy/store.py:657: in prefix s = select([nb_table.c.prefix]).where(nb_table.c.uri == namespace) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = element = [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?", code = None, err = None, kw = {} got = "[Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), ta... select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]. Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING rdflib_sqlalchemy.store:store.py:677 exception in namespace retrieval Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3/rdflib_sqlalchemy/store.py", line 671, in namespace s = select([nb_table.c.uri]).where(nb_table.c.prefix == prefix_val) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select return Select(*entities) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__ self._raw_columns = [ File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5161, in coercions.expect( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect resolved = impl._literal_coercion( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion self._raise_for_expected(element, argname) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected return super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected raise exc.ArgumentError(msg, code=code) from err sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('uri', Text(), table=)]. Did you mean to say select(Column('uri', Text(), table=))? _____________________________________________________________________________ GraphAggregates3.testDefaultGraph _____________________________________________________________________________ self = def setUp(self): memStore = plugin.get('SQLAlchemy', Store)( identifier="rdflib_test", configuration=Literal("sqlite://")) self.graph1 = Graph(memStore, URIRef("graph1")) self.graph2 = Graph(memStore, URIRef("graph2")) self.graph3 = Graph(memStore, URIRef("graph3")) for n3Str, graph in [(testGraph1N3, self.graph1), (testGraph2N3, self.graph2), (testGraph3N3, self.graph3)]: > graph.parse(StringIO(n3Str), format='n3') test/test_aggregate_graphs.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1330: in parse parser.parse(source, self, **args) /usr/lib/python3.8/site-packages/rdflib/plugins/parsers/notation3.py:1975: in parse conj_graph.namespace_manager = graph.namespace_manager /usr/lib/python3.8/site-packages/rdflib/graph.py:396: in namespace_manager self.__namespace_manager = NamespaceManager(self, self._bind_namespaces) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:428: in __init__ self.bind(prefix, ns) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:696: in bind bound_prefix = self.store.prefix(namespace) rdflib_sqlalchemy/store.py:657: in prefix s = select([nb_table.c.prefix]).where(nb_table.c.uri == namespace) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = element = [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?", code = None, err = None, kw = {} got = "[Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), ta... select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]. Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING rdflib_sqlalchemy.store:store.py:677 exception in namespace retrieval Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3/rdflib_sqlalchemy/store.py", line 671, in namespace s = select([nb_table.c.uri]).where(nb_table.c.prefix == prefix_val) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select return Select(*entities) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__ self._raw_columns = [ File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5161, in coercions.expect( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect resolved = impl._literal_coercion( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion self._raise_for_expected(element, argname) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected return super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected raise exc.ArgumentError(msg, code=code) from err sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('uri', Text(), table=)]. Did you mean to say select(Column('uri', Text(), table=))? __________________________________________________________________________________ SQLATestCase.test__len ___________________________________________________________________________________ self = def test__len(self): > self.assertEqual(self.store.__len__(), 0) test/test_sqlalchemy.py:99: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rdflib_sqlalchemy/store.py:217: in __len__ q = union_select(selects, distinct=False, select_type=COUNT_SELECT) rdflib_sqlalchemy/sql.py:65: in union_select select_clause = expression.select([functions.count().label('aCount')]).select_from( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [], argname = None, resolved = None advice = 'Did you mean to say select()?', code = None, err = None, kw = {} got = '[]' msg = 'Column expression, FROM clause, or other columns clause element expected, got []. Did you mean to say select()?' def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got []. Did you mean to say select()? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError _____________________________________________________________________________ SQLATestCase.test__remove_context _____________________________________________________________________________ self = def test__remove_context(self): ctx_id = URIRef('http://example.org/context') g = self.graph.get_context(ctx_id) g.add((michel, likes, pizza)) > self.store._remove_context(g) test/test_sqlalchemy.py:105: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[ArgumentError('Column expression, FROM clause, or other columns clause element expected, got [)?') raised in repr()] SQLAlchemy object at 0x7f7b22d92fa0> context = )> def _remove_context(self, context): """Remove context.""" assert context is not None quoted_table = self.tables["quoted_statements"] asserted_table = self.tables["asserted_statements"] asserted_type_table = self.tables["type_statements"] literal_table = self.tables["literal_statements"] with self.engine.begin() as connection: try: for table in [quoted_table, asserted_table, asserted_type_table, literal_table]: clause = self.build_context_clause(context, table) > connection.execute(table.delete(clause)) E TypeError: delete() takes 1 positional argument but 2 were given rdflib_sqlalchemy/store.py:757: TypeError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR rdflib_sqlalchemy.store:store.py:759 Context removal failed. Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3/rdflib_sqlalchemy/store.py", line 757, in _remove_context connection.execute(table.delete(clause)) TypeError: delete() takes 1 positional argument but 2 were given _____________________________________________________________________________ SQLATestCase.test_contexts_result _____________________________________________________________________________ self = def test_contexts_result(self): ctx_id = URIRef('http://example.org/context') g = self.graph.get_context(ctx_id) g.add((michel, likes, pizza)) > actual = list(self.store.contexts()) test/test_sqlalchemy.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rdflib_sqlalchemy/store.py:627: in contexts q = union_select(selects, distinct=True, select_type=CONTEXT_SELECT) rdflib_sqlalchemy/sql.py:68: in union_select select_clause = expression.select([table.c.context], whereClause) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [Column('context', TermType(), table=, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('context', TermType(), table=, nullable=False))?", code = None, err = None, kw = {} got = "[Column('context', TermType(), table=, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError __________________________________________________________________________ SQLATestCase.test_contexts_with_triple ___________________________________________________________________________ self = def test_contexts_with_triple(self): statemnt = (michel, likes, pizza) > self.assertEqual(list(self.graph.contexts(triple=statemnt)), []) test/test_sqlalchemy.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1892: in contexts for context in self.store.contexts(triple): rdflib_sqlalchemy/store.py:620: in contexts q = union_select(selects, distinct=True, select_type=CONTEXT_SELECT) rdflib_sqlalchemy/sql.py:68: in union_select select_clause = expression.select([table.c.context], whereClause) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [Column('context', TermType(), table=, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('context', TermType(), table=, nullable=False))?", code = None, err = None, kw = {} got = "[Column('context', TermType(), table=, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError _________________________________________________________________________ SQLATestCase.test_contexts_without_triple _________________________________________________________________________ self = def test_contexts_without_triple(self): > self.assertEqual(list(self.graph.contexts()), []) test/test_sqlalchemy.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1892: in contexts for context in self.store.contexts(triple): rdflib_sqlalchemy/store.py:627: in contexts q = union_select(selects, distinct=True, select_type=CONTEXT_SELECT) rdflib_sqlalchemy/sql.py:68: in union_select select_clause = expression.select([table.c.context], whereClause) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [Column('context', TermType(), table=, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('context', TermType(), table=, nullable=False))?", code = None, err = None, kw = {} got = "[Column('context', TermType(), table=, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError _______________________________________________________________________________ SQLATestCase.test_namespaces ________________________________________________________________________________ self = def test_namespaces(self): > self.assertNotEqual(list(self.graph.namespaces()), []) test/test_sqlalchemy.py:82: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1074: in namespaces for prefix, namespace in self.namespace_manager.namespaces(): /usr/lib/python3.8/site-packages/rdflib/graph.py:396: in namespace_manager self.__namespace_manager = NamespaceManager(self, self._bind_namespaces) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:428: in __init__ self.bind(prefix, ns) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:696: in bind bound_prefix = self.store.prefix(namespace) rdflib_sqlalchemy/store.py:657: in prefix s = select([nb_table.c.prefix]).where(nb_table.c.uri == namespace) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = element = [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?", code = None, err = None, kw = {} got = "[Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), ta... select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]. Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING rdflib_sqlalchemy.store:store.py:677 exception in namespace retrieval Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3/rdflib_sqlalchemy/store.py", line 671, in namespace s = select([nb_table.c.uri]).where(nb_table.c.prefix == prefix_val) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select return Select(*entities) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__ self._raw_columns = [ File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5161, in coercions.expect( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect resolved = impl._literal_coercion( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion self._raise_for_expected(element, argname) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected return super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected raise exc.ArgumentError(msg, code=code) from err sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('uri', Text(), table=)]. Did you mean to say select(Column('uri', Text(), table=))? ____________________________________________________________________________ SQLATestCase.test_quoted_statements ____________________________________________________________________________ self = def test_quoted_statements(self): ''' Regression test for RDFLib/rdflib-sqlalchemy#92 ''' cg = ConjunctiveGraph('SQLAlchemy') cg.open('sqlite://', create=True) testN3 = """ @prefix rdf: . @prefix rdfs: . @prefix : . {:a :b :c;a :foo} => {:a :d :c,?y}. _:foo a rdfs:Class. :a :d :c.""" > cg.parse(data=testN3, format='n3') test/test_sqlalchemy.py:139: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1976: in parse context.remove((None, None, None)) # hmm ? /usr/lib/python3.8/site-packages/rdflib/graph.py:478: in remove self.__store.remove(triple, context=self) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[ArgumentError('Column expression, FROM clause, or other columns clause element expected, got [)?') raised in repr()] SQLAlchemy object at 0x7f7b22426310> triple = (None, None, None), context = )> def remove(self, triple, context): """Remove a triple from the store.""" super(SQLAlchemy, self).remove(triple, context) subject, predicate, obj = triple if context is not None: if subject is None and predicate is None and object is None: self._remove_context(context) return quoted_table = self.tables["quoted_statements"] asserted_table = self.tables["asserted_statements"] asserted_type_table = self.tables["type_statements"] literal_table = self.tables["literal_statements"] with self.engine.begin() as connection: try: if predicate is None or predicate != RDF.type: # Need to remove predicates other than rdf:type if not self.STRONGLY_TYPED_TERMS or isinstance(obj, Literal): # remove literal triple clause = self.build_clause(literal_table, subject, predicate, obj, context) > connection.execute(literal_table.delete(clause)) E TypeError: delete() takes 1 positional argument but 2 were given rdflib_sqlalchemy/store.py:399: TypeError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR rdflib_sqlalchemy.store:store.py:419 Removal failed. Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3/rdflib_sqlalchemy/store.py", line 399, in remove connection.execute(literal_table.delete(clause)) TypeError: delete() takes 1 positional argument but 2 were given _____________________________________________________________________________ SQLATestCase.test_triples_choices _____________________________________________________________________________ self = def test_triples_choices(self): # Create a mock for the sqlalchemy engine so we can capture the arguments p = MagicMock(name='engine') self.store.engine = p # Set this so we're not including selects for both asserted and literal tables for # a choice self.store.STRONGLY_TYPED_TERMS = True # Set the grouping of terms self.store.max_terms_per_where = 2 # force execution of the generator > for x in self.store.triples_choices((None, likes, [michel, pizza, likes])): test/test_sqlalchemy.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rdflib_sqlalchemy/store.py:555: in triples_choices for m in self._do_triples_select(selects, context): rdflib_sqlalchemy/store.py:494: in _do_triples_select q = union_select(selects, distinct=True, select_type=TRIPLE_SELECT_NO_ORDER) rdflib_sqlalchemy/sql.py:83: in union_select select_clause = expression.select( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ entities = ([Column('id', Integer(), table=, primary_key=True, nullable=False), Column('subject', TermType(), table=, key='termComb', nullable=False), ...], ) __kw = {'from_obj': []} def select(*entities: _ColumnsClauseArgument[Any], **__kw: Any) -> Select[Any]: r"""Construct a new :class:`_expression.Select`. .. versionadded:: 1.4 - The :func:`_sql.select` function now accepts column arguments positionally. The top-level :func:`_sql.select` function will automatically use the 1.x or 2.x style API based on the incoming arguments; using :func:`_sql.select` from the ``sqlalchemy.future`` module will enforce that only the 2.x style constructor is used. Similar functionality is also available via the :meth:`_expression.FromClause.select` method on any :class:`_expression.FromClause`. .. seealso:: :ref:`tutorial_selecting_data` - in the :ref:`unified_tutorial` :param \*entities: Entities to SELECT from. For Core usage, this is typically a series of :class:`_expression.ColumnElement` and / or :class:`_expression.FromClause` objects which will form the columns clause of the resulting statement. For those objects that are instances of :class:`_expression.FromClause` (typically :class:`_schema.Table` or :class:`_expression.Alias` objects), the :attr:`_expression.FromClause.c` collection is extracted to form a collection of :class:`_expression.ColumnElement` objects. This parameter will also accept :class:`_expression.TextClause` constructs as given, as well as ORM-mapped classes. """ # the keyword args are a necessary element in order for the typing # to work out w/ the varargs vs. having named "keyword" arguments that # aren't always present. if __kw: > raise _no_kw() E sqlalchemy.exc.ArgumentError: Additional keyword arguments are not accepted by this function/method. The presence of **kw is for pep-484 typing purposes /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:492: ArgumentError _____________________________________________________________________________ SQLAlchemyStoreTestCase.testTime ______________________________________________________________________________ self = def testTime(self): # number = 1 print('"Load %s": [' % self.store) for i in ['500triples', '1ktriples', '2ktriples', '3ktriples', '5ktriples', '10ktriples', '25ktriples']: inputloc = os.getcwd() + '/test/sp2b/%s.n3' % i # cleanup graph's so that BNodes in input data # won't create random results self.input = Graph() > self.graph.remove((None, None, None)) test/test_store_performance.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:478: in remove self.__store.remove(triple, context=self) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[ArgumentError('Column expression, FROM clause, or other columns clause element expected, got [)?') raised in repr()] SQLAlchemy object at 0x7f7b21657c40> triple = (None, None, None), context = )> def remove(self, triple, context): """Remove a triple from the store.""" super(SQLAlchemy, self).remove(triple, context) subject, predicate, obj = triple if context is not None: if subject is None and predicate is None and object is None: self._remove_context(context) return quoted_table = self.tables["quoted_statements"] asserted_table = self.tables["asserted_statements"] asserted_type_table = self.tables["type_statements"] literal_table = self.tables["literal_statements"] with self.engine.begin() as connection: try: if predicate is None or predicate != RDF.type: # Need to remove predicates other than rdf:type if not self.STRONGLY_TYPED_TERMS or isinstance(obj, Literal): # remove literal triple clause = self.build_clause(literal_table, subject, predicate, obj, context) > connection.execute(literal_table.delete(clause)) E TypeError: delete() takes 1 positional argument but 2 were given rdflib_sqlalchemy/store.py:399: TypeError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ "Load SQLAlchemy": [ ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR rdflib_sqlalchemy.store:store.py:419 Removal failed. Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.3/rdflib_sqlalchemy/store.py", line 399, in remove connection.execute(literal_table.delete(clause)) TypeError: delete() takes 1 positional argument but 2 were given ===================================================================================== warnings summary ====================================================================================== ../../../../../usr/lib/python3.8/site-packages/_pytest/compat.py:330 /usr/lib/python3.8/site-packages/_pytest/compat.py:330: UserWarning: Code: _pytestfixturefunction is not defined in namespace SDO return getattr(object, name, default) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ================================================================================== short test summary info ================================================================================== SKIPPED [1] test/test_sqlalchemy_mysql.py:20: MySQLdb not found, skipping MySQL tests SKIPPED [1] test/test_sqlalchemy_postgresql.py:10: psycopg2 not installed, skipping PgSQL tests SKIPPED [1] test/test_sqlalchemy_postgresql_pg8000.py:11: pg8000 not installed, skipping PgSQL tests SKIPPED [1] test/test_sqlalchemy_sqlite.py:13: SQLite not under test FAILED test/test_aggregate_graphs.py::GraphAggregates1::testAggregateRaw - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, ... FAILED test/test_aggregate_graphs.py::GraphAggregates3::testDefaultGraph - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, ... FAILED test/test_sqlalchemy.py::SQLATestCase::test__len - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got []. Did you mean to... FAILED test/test_sqlalchemy.py::SQLATestCase::test__remove_context - TypeError: delete() takes 1 positional argument but 2 were given FAILED test/test_sqlalchemy.py::SQLATestCase::test_contexts_result - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you ... FAILED test/test_sqlalchemy.py::SQLATestCase::test_contexts_with_triple - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you me... FAILED test/test_sqlalchemy.py::SQLATestCase::test_contexts_without_triple - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you ... FAILED test/test_sqlalchemy.py::SQLATestCase::test_namespaces - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, ... FAILED test/test_sqlalchemy.py::SQLATestCase::test_quoted_statements - TypeError: delete() takes 1 positional argument but 2 were given FAILED test/test_sqlalchemy.py::SQLATestCase::test_triples_choices - sqlalchemy.exc.ArgumentError: Additional keyword arguments are not accepted by this function/method. The presence of **kw is for pep-484 typing purposes FAILED test/test_store_performance.py::SQLAlchemyStoreTestCase::testTime - TypeError: delete() takes 1 positional argument but 2 were given ==================================================================== 11 failed, 5 passed, 4 skipped, 1 warning in 8.37s ===================================================================== ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ----------------- alabaster 0.7.13 attrs 22.2.0 Babel 2.12.1 build 0.9.0 charset-normalizer 3.0.1 distro 1.8.0 docutils 0.19 exceptiongroup 1.0.0 gpg 1.18.0-unknown greenlet 1.1.3 idna 3.4 imagesize 1.4.1 importlib-metadata 6.0.0 iniconfig 2.0.0 isodate 0.6.1 Jinja2 3.1.2 libcomps 0.1.19 MarkupSafe 2.1.2 packaging 23.0 pep517 0.13.0 pip 22.3.1 pluggy 1.0.0 Pygments 2.14.0 pyparsing 3.0.9 pytest 7.2.2 python-dateutil 2.8.2 pytz 2022.4 rdflib 6.2.0 requests 2.28.2 rpm 4.17.0 setuptools 65.6.3 six 1.16.0 snowballstemmer 2.2.0 Sphinx 6.1.3 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2.dev20230202 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1.dev20230128 sphinxcontrib-qthelp 1.0.3.dev20230128 sphinxcontrib-serializinghtml 1.1.5 SQLAlchemy 2.0.4.dev0 tomli 2.0.1 typing_extensions 4.4.0 urllib3 1.26.12 wheel 0.38.4 zipp 3.15.0 ```
mwatts15 commented 1 year ago

@kloczek, please try 0.5.4. At this point, rdflib-sqlalchemy is not supporting SQLAlchemy version 2 or later.

kloczek commented 1 year ago

OK. Nevertheless pytest still is filing.

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-sqlalchemy-0.5.4-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-sqlalchemy-0.5.4-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.2.2, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4, configfile: pytest.ini, testpaths: test collected 16 items / 4 skipped test/test_aggregate_graphs.py FF [ 12%] test/test_sqlalchemy.py ..FFFFFFF.F [ 81%] test/test_store_performance.py .F [ 93%] test/test_type_to_term_combination.py . [100%] ========================================================================================= FAILURES ========================================================================================== _____________________________________________________________________________ GraphAggregates1.testAggregateRaw _____________________________________________________________________________ self = def setUp(self): memStore = plugin.get('SQLAlchemy', Store)( identifier="rdflib_test", configuration=self.dburi) self.graph1 = Graph(memStore) self.graph2 = Graph(memStore) self.graph3 = Graph(memStore) for n3Str, graph in [(testGraph1N3, self.graph1), (testGraph2N3, self.graph2), (testGraph3N3, self.graph3)]: > graph.parse(StringIO(n3Str), format='n3') test/test_aggregate_graphs.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1330: in parse parser.parse(source, self, **args) /usr/lib/python3.8/site-packages/rdflib/plugins/parsers/notation3.py:1975: in parse conj_graph.namespace_manager = graph.namespace_manager /usr/lib/python3.8/site-packages/rdflib/graph.py:396: in namespace_manager self.__namespace_manager = NamespaceManager(self, self._bind_namespaces) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:428: in __init__ self.bind(prefix, ns) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:696: in bind bound_prefix = self.store.prefix(namespace) rdflib_sqlalchemy/store.py:657: in prefix s = select([nb_table.c.prefix]).where(nb_table.c.uri == namespace) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = element = [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?", code = None, err = None, kw = {} got = "[Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), ta... select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]. Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING rdflib_sqlalchemy.store:store.py:677 exception in namespace retrieval Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4/rdflib_sqlalchemy/store.py", line 671, in namespace s = select([nb_table.c.uri]).where(nb_table.c.prefix == prefix_val) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select return Select(*entities) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__ self._raw_columns = [ File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5161, in coercions.expect( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect resolved = impl._literal_coercion( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion self._raise_for_expected(element, argname) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected return super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected raise exc.ArgumentError(msg, code=code) from err sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('uri', Text(), table=)]. Did you mean to say select(Column('uri', Text(), table=))? _____________________________________________________________________________ GraphAggregates3.testDefaultGraph _____________________________________________________________________________ self = def setUp(self): memStore = plugin.get('SQLAlchemy', Store)( identifier="rdflib_test", configuration=Literal("sqlite://")) self.graph1 = Graph(memStore, URIRef("graph1")) self.graph2 = Graph(memStore, URIRef("graph2")) self.graph3 = Graph(memStore, URIRef("graph3")) for n3Str, graph in [(testGraph1N3, self.graph1), (testGraph2N3, self.graph2), (testGraph3N3, self.graph3)]: > graph.parse(StringIO(n3Str), format='n3') test/test_aggregate_graphs.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1330: in parse parser.parse(source, self, **args) /usr/lib/python3.8/site-packages/rdflib/plugins/parsers/notation3.py:1975: in parse conj_graph.namespace_manager = graph.namespace_manager /usr/lib/python3.8/site-packages/rdflib/graph.py:396: in namespace_manager self.__namespace_manager = NamespaceManager(self, self._bind_namespaces) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:428: in __init__ self.bind(prefix, ns) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:696: in bind bound_prefix = self.store.prefix(namespace) rdflib_sqlalchemy/store.py:657: in prefix s = select([nb_table.c.prefix]).where(nb_table.c.uri == namespace) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = element = [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?", code = None, err = None, kw = {} got = "[Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), ta... select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]. Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING rdflib_sqlalchemy.store:store.py:677 exception in namespace retrieval Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4/rdflib_sqlalchemy/store.py", line 671, in namespace s = select([nb_table.c.uri]).where(nb_table.c.prefix == prefix_val) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select return Select(*entities) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__ self._raw_columns = [ File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5161, in coercions.expect( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect resolved = impl._literal_coercion( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion self._raise_for_expected(element, argname) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected return super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected raise exc.ArgumentError(msg, code=code) from err sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('uri', Text(), table=)]. Did you mean to say select(Column('uri', Text(), table=))? __________________________________________________________________________________ SQLATestCase.test__len ___________________________________________________________________________________ self = def test__len(self): > self.assertEqual(self.store.__len__(), 0) test/test_sqlalchemy.py:99: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rdflib_sqlalchemy/store.py:217: in __len__ q = union_select(selects, distinct=False, select_type=COUNT_SELECT) rdflib_sqlalchemy/sql.py:65: in union_select select_clause = expression.select([functions.count().label('aCount')]).select_from( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [], argname = None, resolved = None advice = 'Did you mean to say select()?', code = None, err = None, kw = {} got = '[]' msg = 'Column expression, FROM clause, or other columns clause element expected, got []. Did you mean to say select()?' def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got []. Did you mean to say select()? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError _____________________________________________________________________________ SQLATestCase.test__remove_context _____________________________________________________________________________ self = def test__remove_context(self): ctx_id = URIRef('http://example.org/context') g = self.graph.get_context(ctx_id) g.add((michel, likes, pizza)) > self.store._remove_context(g) test/test_sqlalchemy.py:105: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[ArgumentError('Column expression, FROM clause, or other columns clause element expected, got [)?') raised in repr()] SQLAlchemy object at 0x7fe620703370> context = )> def _remove_context(self, context): """Remove context.""" assert context is not None quoted_table = self.tables["quoted_statements"] asserted_table = self.tables["asserted_statements"] asserted_type_table = self.tables["type_statements"] literal_table = self.tables["literal_statements"] with self.engine.begin() as connection: try: for table in [quoted_table, asserted_table, asserted_type_table, literal_table]: clause = self.build_context_clause(context, table) > connection.execute(table.delete(clause)) E TypeError: delete() takes 1 positional argument but 2 were given rdflib_sqlalchemy/store.py:757: TypeError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR rdflib_sqlalchemy.store:store.py:759 Context removal failed. Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4/rdflib_sqlalchemy/store.py", line 757, in _remove_context connection.execute(table.delete(clause)) TypeError: delete() takes 1 positional argument but 2 were given _____________________________________________________________________________ SQLATestCase.test_contexts_result _____________________________________________________________________________ self = def test_contexts_result(self): ctx_id = URIRef('http://example.org/context') g = self.graph.get_context(ctx_id) g.add((michel, likes, pizza)) > actual = list(self.store.contexts()) test/test_sqlalchemy.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rdflib_sqlalchemy/store.py:627: in contexts q = union_select(selects, distinct=True, select_type=CONTEXT_SELECT) rdflib_sqlalchemy/sql.py:68: in union_select select_clause = expression.select([table.c.context], whereClause) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [Column('context', TermType(), table=, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('context', TermType(), table=, nullable=False))?", code = None, err = None, kw = {} got = "[Column('context', TermType(), table=, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError __________________________________________________________________________ SQLATestCase.test_contexts_with_triple ___________________________________________________________________________ self = def test_contexts_with_triple(self): statemnt = (michel, likes, pizza) > self.assertEqual(list(self.graph.contexts(triple=statemnt)), []) test/test_sqlalchemy.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1892: in contexts for context in self.store.contexts(triple): rdflib_sqlalchemy/store.py:620: in contexts q = union_select(selects, distinct=True, select_type=CONTEXT_SELECT) rdflib_sqlalchemy/sql.py:68: in union_select select_clause = expression.select([table.c.context], whereClause) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [Column('context', TermType(), table=, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('context', TermType(), table=, nullable=False))?", code = None, err = None, kw = {} got = "[Column('context', TermType(), table=, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError _________________________________________________________________________ SQLATestCase.test_contexts_without_triple _________________________________________________________________________ self = def test_contexts_without_triple(self): > self.assertEqual(list(self.graph.contexts()), []) test/test_sqlalchemy.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1892: in contexts for context in self.store.contexts(triple): rdflib_sqlalchemy/store.py:627: in contexts q = union_select(selects, distinct=True, select_type=CONTEXT_SELECT) rdflib_sqlalchemy/sql.py:68: in union_select select_clause = expression.select([table.c.context], whereClause) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , element = [Column('context', TermType(), table=, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('context', TermType(), table=, nullable=False))?", code = None, err = None, kw = {} got = "[Column('context', TermType(), table=, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you mean to say select(Column('context', TermType(), table=, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError _______________________________________________________________________________ SQLATestCase.test_namespaces ________________________________________________________________________________ self = def test_namespaces(self): > self.assertNotEqual(list(self.graph.namespaces()), []) test/test_sqlalchemy.py:82: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1074: in namespaces for prefix, namespace in self.namespace_manager.namespaces(): /usr/lib/python3.8/site-packages/rdflib/graph.py:396: in namespace_manager self.__namespace_manager = NamespaceManager(self, self._bind_namespaces) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:428: in __init__ self.bind(prefix, ns) /usr/lib/python3.8/site-packages/rdflib/namespace/__init__.py:696: in bind bound_prefix = self.store.prefix(namespace) rdflib_sqlalchemy/store.py:657: in prefix s = select([nb_table.c.prefix]).where(nb_table.c.uri == namespace) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:493: in select return Select(*entities) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5160: in __init__ self._raw_columns = [ /usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py:5161: in coercions.expect( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:413: in expect resolved = impl._literal_coercion( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:652: in _literal_coercion self._raise_for_expected(element, argname) /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:1143: in _raise_for_expected return super()._raise_for_expected( /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:711: in _raise_for_expected super()._raise_for_expected( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = element = [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)], argname = None, resolved = None advice = "Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?", code = None, err = None, kw = {} got = "[Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]" msg = "Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), ta... select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))?" def _raise_for_expected( self, element: Any, argname: Optional[str] = None, resolved: Optional[Any] = None, advice: Optional[str] = None, code: Optional[str] = None, err: Optional[Exception] = None, **kw: Any, ) -> NoReturn: if resolved is not None and resolved is not element: got = "%r object resolved from %r object" % (resolved, element) else: got = repr(element) if argname: msg = "%s expected for argument %r; got %s." % ( self.name, argname, got, ) else: msg = "%s expected, got %s." % (self.name, got) if advice: msg += " " + advice > raise exc.ArgumentError(msg, code=code) from err E sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, primary_key=True, nullable=False)]. Did you mean to say select(Column('prefix', String(length=20), table=, primary_key=True, nullable=False))? /usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py:536: ArgumentError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING rdflib_sqlalchemy.store:store.py:677 exception in namespace retrieval Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4/rdflib_sqlalchemy/store.py", line 671, in namespace s = select([nb_table.c.uri]).where(nb_table.c.prefix == prefix_val) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select return Select(*entities) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__ self._raw_columns = [ File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 5161, in coercions.expect( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect resolved = impl._literal_coercion( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion self._raise_for_expected(element, argname) File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected return super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected super()._raise_for_expected( File "/usr/lib64/python3.8/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected raise exc.ArgumentError(msg, code=code) from err sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('uri', Text(), table=)]. Did you mean to say select(Column('uri', Text(), table=))? ____________________________________________________________________________ SQLATestCase.test_quoted_statements ____________________________________________________________________________ self = def test_quoted_statements(self): ''' Regression test for RDFLib/rdflib-sqlalchemy#92 ''' cg = ConjunctiveGraph('SQLAlchemy') cg.open('sqlite://', create=True) testN3 = """ @prefix rdf: . @prefix rdfs: . @prefix : . {:a :b :c;a :foo} => {:a :d :c,?y}. _:foo a rdfs:Class. :a :d :c.""" > cg.parse(data=testN3, format='n3') test/test_sqlalchemy.py:139: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:1976: in parse context.remove((None, None, None)) # hmm ? /usr/lib/python3.8/site-packages/rdflib/graph.py:478: in remove self.__store.remove(triple, context=self) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[ArgumentError('Column expression, FROM clause, or other columns clause element expected, got [)?') raised in repr()] SQLAlchemy object at 0x7fe6204b55e0> triple = (None, None, None), context = )> def remove(self, triple, context): """Remove a triple from the store.""" super(SQLAlchemy, self).remove(triple, context) subject, predicate, obj = triple if context is not None: if subject is None and predicate is None and object is None: self._remove_context(context) return quoted_table = self.tables["quoted_statements"] asserted_table = self.tables["asserted_statements"] asserted_type_table = self.tables["type_statements"] literal_table = self.tables["literal_statements"] with self.engine.begin() as connection: try: if predicate is None or predicate != RDF.type: # Need to remove predicates other than rdf:type if not self.STRONGLY_TYPED_TERMS or isinstance(obj, Literal): # remove literal triple clause = self.build_clause(literal_table, subject, predicate, obj, context) > connection.execute(literal_table.delete(clause)) E TypeError: delete() takes 1 positional argument but 2 were given rdflib_sqlalchemy/store.py:399: TypeError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR rdflib_sqlalchemy.store:store.py:419 Removal failed. Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4/rdflib_sqlalchemy/store.py", line 399, in remove connection.execute(literal_table.delete(clause)) TypeError: delete() takes 1 positional argument but 2 were given _____________________________________________________________________________ SQLATestCase.test_triples_choices _____________________________________________________________________________ self = def test_triples_choices(self): # Create a mock for the sqlalchemy engine so we can capture the arguments p = MagicMock(name='engine') self.store.engine = p # Set this so we're not including selects for both asserted and literal tables for # a choice self.store.STRONGLY_TYPED_TERMS = True # Set the grouping of terms self.store.max_terms_per_where = 2 # force execution of the generator > for x in self.store.triples_choices((None, likes, [michel, pizza, likes])): test/test_sqlalchemy.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rdflib_sqlalchemy/store.py:555: in triples_choices for m in self._do_triples_select(selects, context): rdflib_sqlalchemy/store.py:494: in _do_triples_select q = union_select(selects, distinct=True, select_type=TRIPLE_SELECT_NO_ORDER) rdflib_sqlalchemy/sql.py:83: in union_select select_clause = expression.select( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ entities = ([Column('id', Integer(), table=, primary_key=True, nullable=False), Column('subject', TermType(), table=, key='termComb', nullable=False), ...], ) __kw = {'from_obj': []} def select(*entities: _ColumnsClauseArgument[Any], **__kw: Any) -> Select[Any]: r"""Construct a new :class:`_expression.Select`. .. versionadded:: 1.4 - The :func:`_sql.select` function now accepts column arguments positionally. The top-level :func:`_sql.select` function will automatically use the 1.x or 2.x style API based on the incoming arguments; using :func:`_sql.select` from the ``sqlalchemy.future`` module will enforce that only the 2.x style constructor is used. Similar functionality is also available via the :meth:`_expression.FromClause.select` method on any :class:`_expression.FromClause`. .. seealso:: :ref:`tutorial_selecting_data` - in the :ref:`unified_tutorial` :param \*entities: Entities to SELECT from. For Core usage, this is typically a series of :class:`_expression.ColumnElement` and / or :class:`_expression.FromClause` objects which will form the columns clause of the resulting statement. For those objects that are instances of :class:`_expression.FromClause` (typically :class:`_schema.Table` or :class:`_expression.Alias` objects), the :attr:`_expression.FromClause.c` collection is extracted to form a collection of :class:`_expression.ColumnElement` objects. This parameter will also accept :class:`_expression.TextClause` constructs as given, as well as ORM-mapped classes. """ # the keyword args are a necessary element in order for the typing # to work out w/ the varargs vs. having named "keyword" arguments that # aren't always present. if __kw: > raise _no_kw() E sqlalchemy.exc.ArgumentError: Additional keyword arguments are not accepted by this function/method. The presence of **kw is for pep-484 typing purposes /usr/lib64/python3.8/site-packages/sqlalchemy/sql/_selectable_constructors.py:492: ArgumentError _____________________________________________________________________________ SQLAlchemyStoreTestCase.testTime ______________________________________________________________________________ self = def testTime(self): # number = 1 print('"Load %s": [' % self.store) for i in ['500triples', '1ktriples', '2ktriples', '3ktriples', '5ktriples', '10ktriples', '25ktriples']: inputloc = os.getcwd() + '/test/sp2b/%s.n3' % i # cleanup graph's so that BNodes in input data # won't create random results self.input = Graph() > self.graph.remove((None, None, None)) test/test_store_performance.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/rdflib/graph.py:478: in remove self.__store.remove(triple, context=self) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[ArgumentError('Column expression, FROM clause, or other columns clause element expected, got [)?') raised in repr()] SQLAlchemy object at 0x7fe61f4c6490> triple = (None, None, None), context = )> def remove(self, triple, context): """Remove a triple from the store.""" super(SQLAlchemy, self).remove(triple, context) subject, predicate, obj = triple if context is not None: if subject is None and predicate is None and object is None: self._remove_context(context) return quoted_table = self.tables["quoted_statements"] asserted_table = self.tables["asserted_statements"] asserted_type_table = self.tables["type_statements"] literal_table = self.tables["literal_statements"] with self.engine.begin() as connection: try: if predicate is None or predicate != RDF.type: # Need to remove predicates other than rdf:type if not self.STRONGLY_TYPED_TERMS or isinstance(obj, Literal): # remove literal triple clause = self.build_clause(literal_table, subject, predicate, obj, context) > connection.execute(literal_table.delete(clause)) E TypeError: delete() takes 1 positional argument but 2 were given rdflib_sqlalchemy/store.py:399: TypeError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ "Load SQLAlchemy": [ ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR rdflib_sqlalchemy.store:store.py:419 Removal failed. Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4/rdflib_sqlalchemy/store.py", line 399, in remove connection.execute(literal_table.delete(clause)) TypeError: delete() takes 1 positional argument but 2 were given ===================================================================================== warnings summary ====================================================================================== ../../../../../usr/lib/python3.8/site-packages/_pytest/compat.py:330 /usr/lib/python3.8/site-packages/_pytest/compat.py:330: UserWarning: Code: _pytestfixturefunction is not defined in namespace SDO return getattr(object, name, default) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ================================================================================== short test summary info ================================================================================== SKIPPED [1] test/test_sqlalchemy_mysql.py:20: MySQLdb not found, skipping MySQL tests SKIPPED [1] test/test_sqlalchemy_postgresql.py:10: psycopg2 not installed, skipping PgSQL tests SKIPPED [1] test/test_sqlalchemy_postgresql_pg8000.py:11: pg8000 not installed, skipping PgSQL tests SKIPPED [1] test/test_sqlalchemy_sqlite.py:13: SQLite not under test FAILED test/test_aggregate_graphs.py::GraphAggregates1::testAggregateRaw - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, ... FAILED test/test_aggregate_graphs.py::GraphAggregates3::testDefaultGraph - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, ... FAILED test/test_sqlalchemy.py::SQLATestCase::test__len - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got []. Did you mean to... FAILED test/test_sqlalchemy.py::SQLATestCase::test__remove_context - TypeError: delete() takes 1 positional argument but 2 were given FAILED test/test_sqlalchemy.py::SQLATestCase::test_contexts_result - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you ... FAILED test/test_sqlalchemy.py::SQLATestCase::test_contexts_with_triple - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you me... FAILED test/test_sqlalchemy.py::SQLATestCase::test_contexts_without_triple - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('context', TermType(), table=, nullable=False)]. Did you ... FAILED test/test_sqlalchemy.py::SQLATestCase::test_namespaces - sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('prefix', String(length=20), table=, ... FAILED test/test_sqlalchemy.py::SQLATestCase::test_quoted_statements - TypeError: delete() takes 1 positional argument but 2 were given FAILED test/test_sqlalchemy.py::SQLATestCase::test_triples_choices - sqlalchemy.exc.ArgumentError: Additional keyword arguments are not accepted by this function/method. The presence of **kw is for pep-484 typing purposes FAILED test/test_store_performance.py::SQLAlchemyStoreTestCase::testTime - TypeError: delete() takes 1 positional argument but 2 were given ==================================================================== 11 failed, 5 passed, 4 skipped, 1 warning in 8.81s ===================================================================== ```
kloczek commented 5 months ago

Just tested 0.5.4 + master and looks like it works +/- one warning

==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/rdflib-sqlalchemy-0.5.4
configfile: pytest.ini
testpaths: test
plugins: timeout-2.3.1, asyncio-0.23.6, mock-3.14.0, metadata-3.1.1, pytest_httpserver-1.0.10, html-4.1.1
asyncio: mode=strict
collected 16 items / 4 skipped

test/test_aggregate_graphs.py ..                                                                                                                                                      [ 12%]
test/test_sqlalchemy.py ...........                                                                                                                                                   [ 81%]
test/test_store_performance.py ..                                                                                                                                                     [ 93%]
test/test_type_to_term_combination.py .                                                                                                                                               [100%]

===================================================================================== warnings summary ======================================================================================
../../../../../usr/lib/python3.9/site-packages/_pytest/compat.py:287
  /usr/lib/python3.9/site-packages/_pytest/compat.py:287: UserWarning: Code: _pytestfixturefunction is not defined in namespace SDO
    return getattr(object, name, default)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
SKIPPED [1] test/test_sqlalchemy_mysql.py:20: MySQLdb not found, skipping MySQL tests
SKIPPED [1] test/test_sqlalchemy_postgresql.py:10: psycopg2 not installed, skipping PgSQL tests
SKIPPED [1] test/test_sqlalchemy_postgresql_pg8000.py:11: pg8000 not installed, skipping PgSQL tests
SKIPPED [1] test/test_sqlalchemy_sqlite.py:13: SQLite not under test
========================================================================= 16 passed, 4 skipped, 1 warning in 13.86s =========================================================================

Above is with my patch which removes use six and drops python<=3.7 support. Would you accept that as PR? 🤔