Skip to content

Commit 92246d0

Browse files
authored
Merge branch 'dbcli:main' into feature/555/support-warnings
2 parents 688999f + cbfa4f6 commit 92246d0

File tree

9 files changed

+27
-24
lines changed

9 files changed

+27
-24
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1818

1919
steps:
20-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
20+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2121

22-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
22+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2323
with:
2424
version: "latest"
2525

@@ -54,9 +54,9 @@ jobs:
5454
runs-on: ubuntu-latest
5555

5656
steps:
57-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
57+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5858

59-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
59+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
6060
with:
6161
version: "latest"
6262

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Check out Git repository
16-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
16+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1717

1818
# remember to sync the ruff-check version number with pyproject.toml
1919
- name: Run ruff check

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
15+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1616

1717
- name: Require release changelog form
1818
run: |
@@ -28,8 +28,8 @@ jobs:
2828
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2929

3030
steps:
31-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
32-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
31+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
32+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
3333
with:
3434
version: "latest"
3535

@@ -67,8 +67,8 @@ jobs:
6767
needs: [test]
6868

6969
steps:
70-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
71-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
70+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
71+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
7272
with:
7373
version: "latest"
7474

@@ -84,7 +84,7 @@ jobs:
8484
run: uv build
8585

8686
- name: Store the distribution packages
87-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
87+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
8888
with:
8989
name: python-packages
9090
path: dist/
@@ -99,7 +99,7 @@ jobs:
9999
id-token: write
100100
steps:
101101
- name: Download distribution packages
102-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
102+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
103103
with:
104104
name: python-packages
105105
path: dist/

.github/workflows/typecheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313

1414
steps:
1515
- name: Check out Git repository
16-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
16+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1717

1818
- name: Set up Python
1919
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2020
with:
2121
python-version: '3.13'
2222

23-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
23+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2424
with:
2525
version: 'latest'
2626

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Features
1111
Internal
1212
--------
1313
* Improve robustness for flaky tests when publishing.
14+
* Improve type annotations for latest mypy/type stubs.
15+
* Set mypy version more strictly.
1416

1517

1618
1.41.2 (2025/11/24)

mycli/packages/completion_engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def suggest_type(full_text: str, text_before_cursor: str) -> list[dict[str, Any]
7777

7878
last_token = statement and statement.token_prev(len(statement.tokens))[1] or ""
7979

80-
return suggest_based_on_last_token(last_token, text_before_cursor, full_text, identifier)
80+
# todo: unsure about empty string as identifier
81+
return suggest_based_on_last_token(last_token, text_before_cursor, full_text, identifier or Identifier(''))
8182

8283

8384
def suggest_special(text: str) -> list[dict[str, Any]]:

mycli/packages/parseutils.py

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

33
import re
4-
from typing import Generator
4+
from typing import Any, Generator
55

66
import sqlglot
77
import sqlparse
@@ -77,7 +77,7 @@ def is_subselect(parsed: TokenList) -> bool:
7777
return False
7878

7979

80-
def extract_from_part(parsed: TokenList, stop_at_punctuation: bool = True) -> Generator[str, None, None]:
80+
def extract_from_part(parsed: TokenList, stop_at_punctuation: bool = True) -> Generator[Any, None, None]:
8181
tbl_prefix_seen = False
8282
for item in parsed.tokens:
8383
if tbl_prefix_seen:
@@ -123,7 +123,7 @@ def extract_from_part(parsed: TokenList, stop_at_punctuation: bool = True) -> Ge
123123
break
124124

125125

126-
def extract_table_identifiers(token_stream: TokenList) -> Generator[tuple[str | None, str, str], None, None]:
126+
def extract_table_identifiers(token_stream: Generator[Any, None, None]) -> Generator[tuple[str | None, str, str], None, None]:
127127
"""yields tuples of (schema_name, table_name, table_alias)"""
128128

129129
for item in token_stream:
@@ -187,15 +187,15 @@ def extract_tables_from_complete_statements(sql: str) -> list[tuple[str | None,
187187
return []
188188

189189
finely_parsed = []
190-
for statement in roughly_parsed:
190+
for rough_statement in roughly_parsed:
191191
try:
192-
finely_parsed.append(sqlglot.parse_one(str(statement), read='mysql'))
192+
finely_parsed.append(sqlglot.parse_one(str(rough_statement), read='mysql'))
193193
except sqlglot.errors.ParseError:
194194
pass
195195

196196
tables = []
197-
for statement in finely_parsed:
198-
for identifier in statement.find_all(sqlglot.exp.Table):
197+
for fine_statement in finely_parsed:
198+
for identifier in fine_statement.find_all(sqlglot.exp.Table):
199199
if identifier.parent_select and identifier.parent_select.sql().startswith('WITH'):
200200
continue
201201
tables.append((

mycli/packages/special/iocommands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def execute_favorite_query(cur: Cursor, arg: str, **_) -> Generator[tuple, None,
255255
yield (None, None, None, message)
256256
else:
257257
query, arg_error = subst_favorite_query_args(query, args)
258-
if arg_error:
258+
if query is None:
259259
yield (None, None, None, arg_error)
260260
else:
261261
for sql in sqlparse.split(query):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ all = [
4444
dev = [
4545
"behave>=1.2.6",
4646
"coverage>=7.2.7",
47-
"mypy>=1.16.1",
47+
"mypy~=1.18.1",
4848
"pexpect>=4.9.0",
4949
"pytest>=7.4.4",
5050
"pytest-cov>=4.1.0",

0 commit comments

Comments
 (0)