Merging upstream version 16.7.7.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4d512c00f3
commit
70bf18533e
59 changed files with 16125 additions and 15681 deletions
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
from concurrent.futures import ProcessPoolExecutor, as_completed
|
||||
from functools import partial
|
||||
from unittest.mock import patch
|
||||
|
||||
import duckdb
|
||||
from pandas.testing import assert_frame_equal
|
||||
|
@ -14,6 +15,7 @@ from sqlglot.schema import MappingSchema
|
|||
from tests.helpers import (
|
||||
TPCDS_SCHEMA,
|
||||
TPCH_SCHEMA,
|
||||
assert_logger_contains,
|
||||
load_sql_fixture_pairs,
|
||||
load_sql_fixtures,
|
||||
string_to_bool,
|
||||
|
@ -411,6 +413,15 @@ FROM READ_CSV('tests/fixtures/optimizer/tpc-h/nation.csv.gz', 'delimiter', '|')
|
|||
{"s.b"},
|
||||
)
|
||||
|
||||
@patch("sqlglot.optimizer.scope.logger")
|
||||
def test_scope_warning(self, logger):
|
||||
self.assertEqual(len(traverse_scope(parse_one("WITH q AS (@y) SELECT * FROM q"))), 1)
|
||||
assert_logger_contains(
|
||||
"Cannot traverse scope %s with type '%s'",
|
||||
logger,
|
||||
level="warning",
|
||||
)
|
||||
|
||||
def test_literal_type_annotation(self):
|
||||
tests = {
|
||||
"SELECT 5": exp.DataType.Type.INT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue