Skip to content

Commit 2156fd5

Browse files
authored
Reformat files with project:fix for later resolving vulnerabilities (#578)
1 parent d4f4c71 commit 2156fd5

File tree

8 files changed

+30
-33
lines changed

8 files changed

+30
-33
lines changed

doc/changes/unreleased.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Unreleased
22

3-
## 🔧 Changed
4-
5-
- #558 Updated to poetry 2.1.2 & relocked dependencies to resolve CVE-2025-27516
6-
- Relocked dependencies to resolve CVE-2025-43859
7-
83
## 🧰 Internal
94

5+
- #558 Updated to poetry 2.1.2 & relocked dependencies to resolve CVE-2025-27516
106
- #548: Replaced pytest-exasol-itde with pytest-backend
7+
- - Relocked dependencies to resolve CVE-2025-43859
118
- #564: Replaced nox test:unit with that from exasol-toolbox
12-
9+
- Reformatted files to meet project specifications

exasol/odbc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from __future__ import annotations
22

33
import os
4-
from contextlib import contextmanager
5-
from pathlib import Path
6-
from tempfile import TemporaryDirectory
7-
from textwrap import dedent
8-
from typing import (
4+
from collections.abc import (
95
Iterable,
106
Iterator,
117
MutableMapping,
128
)
9+
from contextlib import contextmanager
10+
from pathlib import Path
11+
from tempfile import TemporaryDirectory
12+
from textwrap import dedent
1313

1414
from pyodbc import Connection
1515

noxconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Iterable
34
from dataclasses import dataclass
45
from pathlib import Path
5-
from typing import Iterable
66

77
from exasol.toolbox.nox.plugin import hookimpl
88

scripts/links.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import subprocess
22
import urllib.error
3+
from collections.abc import (
4+
Container,
5+
Iterable,
6+
)
37
from itertools import repeat
48
from pathlib import Path
59
from typing import (
6-
Container,
7-
Iterable,
810
Optional,
911
Tuple,
1012
)
@@ -21,7 +23,7 @@ def _deny_filter(path: Path) -> bool:
2123
return filter(lambda path: _deny_filter(path), docs)
2224

2325

24-
def urls(files: Iterable[Path]) -> Iterable[Tuple[Path, str]]:
26+
def urls(files: Iterable[Path]) -> Iterable[tuple[Path, str]]:
2527
"""Returns an iterable over all urls contained in the provided files"""
2628

2729
def should_filter(url: str) -> bool:
@@ -41,7 +43,7 @@ def should_filter(url: str) -> bool:
4143
yield from zip(repeat(file), filter(lambda url: not should_filter(url), _urls))
4244

4345

44-
def check(url: str) -> Tuple[Optional[int], str]:
46+
def check(url: str) -> tuple[Optional[int], str]:
4547
"""Checks if an url is still working (can be accessed)"""
4648
try:
4749
# User-Agent needs to be faked otherwise some webpages will deny access with a 403

scripts/report.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
FileType,
88
)
99
from collections import namedtuple
10+
from collections.abc import (
11+
Generator,
12+
Iterable,
13+
)
1014
from typing import (
1115
Any,
1216
Dict,
13-
Generator,
14-
Iterable,
1517
TextIO,
1618
)
1719

@@ -27,7 +29,7 @@
2729
)
2830

2931

30-
def skipped_test_from(obj: Dict[str, Any]) -> Test:
32+
def skipped_test_from(obj: dict[str, Any]) -> Test:
3133
for stage in ("setup", "call", "teardown"):
3234
try:
3335
filename, _, details = eval(obj[stage]["longrepr"])
@@ -74,7 +76,7 @@ def _human(tests: Iterable[Test], output: TextIO) -> None:
7476
def _csv(tests: Iterable[Test], output: TextIO) -> None:
7577
fields = ("test-case", "status", "details")
7678

77-
def test_to_entry(t: Test) -> Dict[str, Any]:
79+
def test_to_entry(t: Test) -> dict[str, Any]:
7880
return {
7981
"test-case": t.nodeid,
8082
"status": t.outcome,
@@ -88,7 +90,7 @@ def test_to_entry(t: Test) -> Dict[str, Any]:
8890

8991

9092
def main(
91-
test_results: str, output: TextIO, format: str, **kwargs: Dict[str, Any]
93+
test_results: str, output: TextIO, format: str, **kwargs: dict[str, Any]
9294
) -> int:
9395
skipped_tests = all_skipped_tests(test_results)
9496
dispatcher = {"human": _human, "csv": _csv}

scripts/version_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Namespace,
66
)
77
from collections import namedtuple
8+
from collections.abc import Iterable
89
from inspect import cleandoc
910
from pathlib import Path
1011
from shutil import which
1112
from typing import (
1213
Any,
1314
Dict,
14-
Iterable,
1515
Union,
1616
)
1717

@@ -50,8 +50,8 @@ class CommitHookError(Exception):
5050
def version_from_python_module(path: Path) -> Version:
5151
"""Retrieve version information from the `version` module"""
5252
with open(path) as file:
53-
_locals: Dict[str, Any] = {}
54-
_globals: Dict[str, Any] = {}
53+
_locals: dict[str, Any] = {}
54+
_globals: dict[str, Any] = {}
5555
exec(file.read(), _locals, _globals)
5656

5757
try:

sqlalchemy_exasol/base.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@
4848
import logging
4949
import re
5050
from contextlib import closing
51-
from datetime import (
52-
date,
53-
datetime,
54-
)
55-
from decimal import Decimal
5651

5752
import sqlalchemy.exc
5853
from sqlalchemy import (
@@ -551,7 +546,8 @@
551546
"CLOB": sqltypes.TEXT,
552547
"DATE": sqltypes.DATE,
553548
"DECIMAL": sqltypes.DECIMAL,
554-
"DOUBLE": sqltypes.FLOAT, # EXASOL mapps DOUBLE, DOUBLE PRECISION, FLOAT to DOUBLE PRECISION
549+
"DOUBLE": sqltypes.FLOAT,
550+
# EXASOL mapps DOUBLE, DOUBLE PRECISION, FLOAT to DOUBLE PRECISION
555551
# internally but returns 'DOUBLE' as type when asking the DB catalog
556552
# INTERVAL DAY [(p)] TO SECOND [(fp)] TODO: missing support for EXA Datatype, check Oracle Engine
557553
# INTERVAL YEAR[(p)] TO MONTH TODO: missing support for EXA Datatype, check Oracle Engine

sqlalchemy_exasol/version.py

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)