Skip to content

Commit 00ddf55

Browse files
committed
revert suppression of sqlglotrs warnings
since we are committed to sqlglot 30.x, which has a better fix upstream
1 parent 3d80770 commit 00ddf55

4 files changed

Lines changed: 9 additions & 33 deletions

File tree

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Features
66
* Add a `--batch` option as an alternative to STDIN.
77

88

9+
Bug Fixes
10+
---------
11+
* Revert suppression of warnings when `sqlglotrs` is installed (fixed upstream).
12+
13+
914
Internal
1015
--------
1116
* Harden `codex-review` workflow against script injection from untrusted PR metadata.

mycli/main.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from textwrap import dedent
2727
from time import sleep, time
2828
from urllib.parse import parse_qs, unquote, urlparse
29-
import warnings
3029

3130
from cli_helpers.tabular_output import TabularOutputFormatter, preprocessors
3231
from cli_helpers.tabular_output.output_formatter import MISSING_VALUE as DEFAULT_MISSING_VALUE
@@ -59,18 +58,9 @@
5958
from pymysql.constants.CR import CR_SERVER_LOST
6059
from pymysql.constants.ER import ACCESS_DENIED_ERROR, HANDSHAKE_ERROR
6160
from pymysql.cursors import Cursor
61+
import sqlglot
6262
import sqlparse
6363

64-
with warnings.catch_warnings():
65-
# for sqlglot v29.0.1
66-
warnings.filterwarnings(
67-
'ignore',
68-
message=r'sqlglot\[rs\] is deprecated',
69-
category=UserWarning,
70-
module='sqlglot',
71-
)
72-
import sqlglot
73-
7464
from mycli import __version__
7565
from mycli.clibuffer import cli_is_multiline
7666
from mycli.clistyle import style_factory_helpers, style_factory_toolkit

mycli/packages/hybrid_redirection.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
import functools
22
import logging
3-
import warnings
4-
5-
with warnings.catch_warnings():
6-
# for sqlglot v29.0.1
7-
warnings.filterwarnings(
8-
'ignore',
9-
message=r'sqlglot\[rs\] is deprecated',
10-
category=UserWarning,
11-
module='sqlglot',
12-
)
13-
import sqlglot
3+
4+
import sqlglot
145

156
from mycli.compat import WIN
167
from mycli.packages.special.delimitercommand import DelimiterCommand

mycli/packages/parseutils.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,12 @@
22

33
import re
44
from typing import Any, Generator, Literal
5-
import warnings
65

6+
import sqlglot
77
import sqlparse
88
from sqlparse.sql import Function, Identifier, IdentifierList, Token, TokenList
99
from sqlparse.tokens import DML, Keyword, Punctuation
1010

11-
with warnings.catch_warnings():
12-
# for sqlglot v29.0.1
13-
warnings.filterwarnings(
14-
'ignore',
15-
message=r'sqlglot\[rs\] is deprecated',
16-
category=UserWarning,
17-
module='sqlglot',
18-
)
19-
import sqlglot
20-
2111
sqlparse.engine.grouping.MAX_GROUPING_DEPTH = None # type: ignore[assignment]
2212
sqlparse.engine.grouping.MAX_GROUPING_TOKENS = None # type: ignore[assignment]
2313

0 commit comments

Comments
 (0)