diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-02 23:59:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-02 23:59:46 +0000 |
commit | 20739a12c39121a9e7ad3c9a2469ec5a6876199d (patch) | |
tree | c000de91c59fd29b2d9beecf9f93b84e69727f37 /sqlglot/__init__.py | |
parent | Releasing debian version 12.2.0-1. (diff) | |
download | sqlglot-20739a12c39121a9e7ad3c9a2469ec5a6876199d.tar.xz sqlglot-20739a12c39121a9e7ad3c9a2469ec5a6876199d.zip |
Merging upstream version 15.0.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/__init__.py')
-rw-r--r-- | sqlglot/__init__.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sqlglot/__init__.py b/sqlglot/__init__.py index f7440e0..8fb623a 100644 --- a/sqlglot/__init__.py +++ b/sqlglot/__init__.py @@ -6,6 +6,7 @@ from __future__ import annotations +import logging import typing as t from sqlglot import expressions as exp @@ -45,12 +46,19 @@ from sqlglot.schema import MappingSchema as MappingSchema, Schema as Schema from sqlglot.tokens import Tokenizer as Tokenizer, TokenType as TokenType if t.TYPE_CHECKING: + from sqlglot._typing import E from sqlglot.dialects.dialect import DialectType as DialectType - T = t.TypeVar("T", bound=Expression) +logger = logging.getLogger("sqlglot") -__version__ = "12.2.0" +try: + from sqlglot._version import __version__, __version_tuple__ +except ImportError: + logger.error( + "Unable to set __version__, run `pip install -e .` or `python setup.py develop` first." + ) + pretty = False """Whether to format generated SQL by default.""" @@ -79,9 +87,9 @@ def parse(sql: str, read: DialectType = None, **opts) -> t.List[t.Optional[Expre def parse_one( sql: str, read: None = None, - into: t.Type[T] = ..., + into: t.Type[E] = ..., **opts, -) -> T: +) -> E: ... @@ -89,9 +97,9 @@ def parse_one( def parse_one( sql: str, read: DialectType, - into: t.Type[T], + into: t.Type[E], **opts, -) -> T: +) -> E: ... |