1
0
Fork 0

Merging upstream version 16.7.7.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 20:39:26 +01:00
parent 4d512c00f3
commit 70bf18533e
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
59 changed files with 16125 additions and 15681 deletions

View file

@ -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,