• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SAP / sqlalchemy-hana / 16903089783

29 Jul 2025 10:19AM UTC coverage: 85.857% (-10.0%) from 95.896%
16903089783

push

github

web-flow
Bump diff-cover[toml] from 9.5.0 to 9.6.0 (#409)

Bumps [diff-cover[toml]](https://github.com/Bachmann1234/diff-cover)
from 9.5.0 to 9.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Bachmann1234/diff-cover/releases">diff-cover[toml]'s
releases</a>.</em></p>
<blockquote>
<h2>Version 9.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fixes bug when using diff-cover --format markdown:- by <a
href="https://github.com/kingbuzzman"><code>@​kingbuzzman</code></a> in
<a
href="https://redirect.github.com/Bachmann1234/diff_cover/pull/516">Bachmann1234/diff_cover#516</a></li>
<li>GitHub annotations by <a
href="https://github.com/timkrins"><code>@​timkrins</code></a> in <a
href="https://redirect.github.com/Bachmann1234/diff_cover/pull/432">Bachmann1234/diff_cover#432</a></li>
</ul>
<h2>Readme tweak</h2>
<ul>
<li>Updates the name of the ruff check command by <a
href="https://github.com/kingbuzzman"><code>@​kingbuzzman</code></a> in
<a
href="https://redirect.github.com/Bachmann1234/diff_cover/pull/515">Bachmann1234/diff_cover#515</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/timkrins"><code>@​timkrins</code></a>
made their first contribution in <a
href="https://redirect.github.com/Bachmann1234/diff_cover/pull/432">Bachmann1234/diff_cover#432</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Bachmann1234/diff_cover/compare/v9.5.0...v9.6.0">https://github.com/Bachmann1234/diff_cover/compare/v9.5.0...v9.6.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Bachmann1234/diff_cover/blob/main/CHANGELOG">diff-cover[toml]'s
changelog</a>.</em></p>
<blockquote>
<p>07/16/2025 v9.6.0</p>
<ul>
<li>Fixes issue when sending markdown reports to stdout. Thanks <a
href="https://github.com/kingbuzzman"><code>@​kingbuzzman</code></a>! <a
href="https://redirect.github.com/Bachmann1234/diff_cover/pull/516">PR
516</a... (continued)

1548 of 1803 relevant lines covered (85.86%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.51
/test/test_sqlalchemy_dialect_suite.py
1
# pylint: disable=wildcard-import,unused-wildcard-import,function-redefined,arguments-differ
2
# pylint: disable=redefined-outer-name
3
"""SQLAlchemy dialect test suite."""
4

5
from __future__ import annotations
1✔
6

7
from typing import Any
1✔
8

9
import pytest
1✔
10
from sqlalchemy import (
1✔
11
    ForeignKey,
12
    ForeignKeyConstraint,
13
    Integer,
14
    String,
15
    inspect,
16
    testing,
17
)
18
from sqlalchemy.exc import DBAPIError
×
19
from sqlalchemy.testing.assertions import assert_raises, eq_
×
20
from sqlalchemy.testing.provision import temp_table_keyword_args
1✔
21
from sqlalchemy.testing.schema import Column, Table
1✔
22
from sqlalchemy.testing.suite import *  # noqa: F401, F403
1✔
23
from sqlalchemy.testing.suite.test_cte import CTETest as _CTETest
1✔
24
from sqlalchemy.testing.suite.test_reflection import (
1✔
25
    ComponentReflectionTest as _ComponentReflectionTest,
26
)
27
from sqlalchemy.testing.suite.test_reflection import (
1✔
28
    ComponentReflectionTestExtra as _ComponentReflectionTestExtra,
29
)
30
from sqlalchemy.testing.suite.test_reflection import (
1✔
31
    IdentityReflectionTest as _IdentityReflectionTest,
32
)
33
from sqlalchemy.testing.suite.test_select import (
1✔
34
    IdentityColumnTest as _IdentityColumnTest,
35
)
36
from sqlalchemy.testing.suite.test_types import JSONTest as _JSONTest
×
37

38
# Import dialect test suite provided by SQLAlchemy into SQLAlchemy-HANA test collection.
39
# Please don't add other tests in this file. Only adjust or overview SQLAlchemy tests
40
# for compatibility with SAP HANA.
41

42

43
@temp_table_keyword_args.for_db("*")
×
44
def _temp_table_keyword_args(*args: Any, **kwargs: Any) -> dict[str, list[str]]:
1✔
45
    return {
×
46
        "prefixes": ["GLOBAL TEMPORARY"],
47
    }
48

49

50
class ComponentReflectionTestExtra(_ComponentReflectionTestExtra):
×
51
    @testing.combinations(
1✔
52
        ("CASCADE", None),
53
        (None, "SET NULL"),
54
        (None, "RESTRICT"),
55
        (None, "RESTRICT"),
56
        argnames="ondelete,onupdate",
57
    )
58
    def test_get_foreign_key_options(self, connection, metadata, ondelete, onupdate):
1✔
59
        options = {}
1✔
60
        if ondelete:
×
61
            options["ondelete"] = ondelete
×
62
        if onupdate:
×
63
            options["onupdate"] = onupdate
1✔
64

65
        options.setdefault("ondelete", "RESTRICT")
1✔
66
        options.setdefault("onupdate", "RESTRICT")
1✔
67

68
        Table(
1✔
69
            "x",
70
            metadata,
71
            Column("id", Integer, primary_key=True),
72
            test_needs_fk=True,
73
        )
74

75
        Table(
1✔
76
            "table",
77
            metadata,
78
            Column("id", Integer, primary_key=True),
79
            Column("x_id", Integer, ForeignKey("x.id", name="xid")),
80
            Column("test", String(10)),
81
            test_needs_fk=True,
82
        )
83

84
        Table(
1✔
85
            "user",
86
            metadata,
87
            Column("id", Integer, primary_key=True),
88
            Column("name", String(50), nullable=False),
89
            Column("tid", Integer),
90
            ForeignKeyConstraint(["tid"], ["table.id"], name="myfk", **options),
91
            test_needs_fk=True,
92
        )
93

94
        metadata.create_all(connection)
1✔
95

96
        insp = inspect(connection)
×
97

98
        # test 'options' is always present for a backend
99
        # that can reflect these, since alembic looks for this
100
        opts = insp.get_foreign_keys("table")[0]["options"]
1✔
101

102
        eq_(
1✔
103
            {k: opts[k] for k in opts if opts[k]},
104
            {"onupdate": "RESTRICT", "ondelete": "RESTRICT"},
105
        )
106

107
        opts = insp.get_foreign_keys("user")[0]["options"]
1✔
108
        eq_(opts, options)
×
109

110

111
class ComponentReflectionTest(_ComponentReflectionTest):
×
112
    def _check_table_dict(self, result, exp, req_keys=None, make_lists=False):
×
113
        def _normalize(data):
1✔
114
            for entry in data.values():
×
115
                if isinstance(entry, list):
1✔
116
                    for subentry in entry:
1✔
117
                        if "sqltext" not in subentry:
1✔
118
                            continue
×
119
                        sqltext = subentry["sqltext"]
×
120
                        # ignore casing
121
                        sqltext = sqltext.lower()
1✔
122
                        # removes spaces because they are not consistent
123
                        sqltext = sqltext.replace(" ", "")
1✔
124
                        # remove quotes because they are not consistent
125
                        sqltext = sqltext.replace('"', "")
1✔
126
                        # remove a potential leading (
127
                        if sqltext.startswith("("):
1✔
128
                            sqltext = sqltext[1:]
1✔
129
                        # remove a potential closing )
130
                        if sqltext.endswith(")"):
1✔
131
                            sqltext = sqltext[:-1]
×
132
                        subentry["sqltext"] = sqltext
1✔
133

134
        _normalize(result)
1✔
135
        _normalize(exp)
1✔
136
        return super()._check_table_dict(result, exp, req_keys, make_lists)
1✔
137

138

139
class CTETest(_CTETest):
1✔
140
    def test_select_recursive_round_trip(self, connection):
×
141
        pytest.skip("Recursive CTEs are not supported by SAP HANA")
1✔
142

143
    def test_insert_from_select_round_trip(self, connection):
×
144
        pytest.skip("Insert CTEs are not supported by SAP HANA")
×
145

146

147
class IdentityReflectionTest(_IdentityReflectionTest):
1✔
148
    def test_reflect_identity(self, connection):
1✔
149
        pytest.skip("Identity column reflection is not supported")
1✔
150

151
    def test_reflect_identity_schema(self, connection):
1✔
152
        pytest.skip("Identity column reflection is not supported")
1✔
153

154

155
class IdentityColumnTest(_IdentityColumnTest):
1✔
156
    def test_insert_always_error(self, connection):
×
157
        def fn():
1✔
158
            connection.execute(
1✔
159
                self.tables.tbl_a.insert(),
160
                [{"id": 200, "desc": "a"}],
161
            )
162

163
        assert_raises((DBAPIError,), fn)
×
164

165

166
class JSONTest(_JSONTest):
1✔
167
    @classmethod
×
168
    def define_tables(cls, metadata):
1✔
169
        Table(
1✔
170
            "data_table",
171
            metadata,
172
            Column("id", Integer, autoincrement=True, primary_key=True),
173
            Column("name", String(30), nullable=False),
174
            Column("data", cls.datatype, nullable=False),
175
            Column("nulldata", cls.datatype(none_as_null=True)),
176
        )
177

178
    def test_index_typed_access(self):
1✔
179
        pytest.skip("Index typed access is not supported")
×
180

181
    def test_index_typed_comparison(self):
1✔
182
        pytest.skip("Index typed access is not supported")
1✔
183

184
    def test_path_typed_comparison(self):
×
185
        pytest.skip("Path typed access is not supported")
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc