Field "type" of type Optional[StarRocksRelationType] in StarRocksRelation has invalid value 'cte'
Closed this issue · 1 comments
alberttwong commented
CLIENT: Server listening on port 63061...
Received JSON data in run script
Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=/Users/atwong/sandbox/dbt-starrocks', '/Users/atwong/sandbox/dbt-starrocks/tests/functional/adapter/test_basic.py::TestEphemeralMyAdapter::test_ephemeral']
============================= test session starts ==============================
platform darwin -- Python 3.9.16, pytest-8.1.1, pluggy-1.4.0
rootdir: /Users/atwong/sandbox/dbt-starrocks
configfile: pytest.ini
plugins: dotenv-0.5.2
collected 1 item
tests/functional/adapter/test_basic.py F [100%]
=================================== FAILURES ===================================
____________________ TestEphemeralMyAdapter.test_ephemeral _____________________
self = <test_basic.TestEphemeralMyAdapter object at 0x109815250>
project = <dbt.tests.fixtures.project.TestProjInfo object at 0x107810c40>
def test_ephemeral(self, project):
# seed command
results = run_dbt(["seed"])
assert len(results) == 1
check_result_nodes_by_name(results, ["base"])
# run command
> results = run_dbt(["run"])
/Users/atwong/dbt-env/lib/python3.9/site-packages/dbt/tests/adapter/basic/test_ephemeral.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = ['run', '--project-dir', '/private/var/folders/xn/_h8gfpfs3vv_m6gkxm8t0l380000gn/T/pytest-of-atwong/pytest-91/project0', '--profiles-dir', '/private/var/folders/xn/_h8gfpfs3vv_m6gkxm8t0l380000gn/T/pytest-of-atwong/pytest-91/profile0']
expect_pass = True
def run_dbt(
args: Optional[List[str]] = None,
expect_pass: bool = True,
):
# Ignore logbook warnings
warnings.filterwarnings("ignore", category=DeprecationWarning, module="logbook")
# reset global vars
reset_metadata_vars()
# The logger will complain about already being initialized if
# we don't do this.
log_manager.reset_handlers()
if args is None:
args = ["run"]
print("\n\nInvoking dbt with {}".format(args))
from dbt.flags import get_flags
flags = get_flags()
project_dir = getattr(flags, "PROJECT_DIR", None)
profiles_dir = getattr(flags, "PROFILES_DIR", None)
if project_dir and "--project-dir" not in args:
args.extend(["--project-dir", project_dir])
if profiles_dir and "--profiles-dir" not in args:
args.extend(["--profiles-dir", profiles_dir])
dbt = dbtRunner()
res = dbt.invoke(args)
# the exception is immediately raised to be caught in tests
# using a pattern like `with pytest.raises(SomeException):`
if res.exception is not None:
raise res.exception
if expect_pass is not None:
> assert res.success == expect_pass, "dbt exit state did not match expected"
E AssertionError: dbt exit state did not match expected
/Users/atwong/dbt-env/lib/python3.9/site-packages/dbt/tests/util.py:108: AssertionError
---------------------------- Captured stdout setup -----------------------------
=== Test project_root: /private/var/folders/xn/_h8gfpfs3vv_m6gkxm8t0l380000gn/T/pytest-of-atwong/pytest-91/project0
----------------------------- Captured stdout call -----------------------------
Invoking dbt with ['seed']
22:50:31 Running with dbt=1.6.2
22:50:31 Registered adapter: starrocks=1.4.2
22:50:31 Unable to do partial parsing because saved manifest not found. Starting full parse.
22:50:32 Found 3 models, 1 seed, 1 source, 0 exposures, 0 metrics, 335 macros, 0 groups, 0 semantic models
22:50:32
22:50:32 Concurrency: 1 threads (target='default')
22:50:32
22:50:32 1 of 1 START seed file test17102838317511145591_test_basic.base ................ [RUN]
22:50:32 1 of 1 OK loaded seed file test17102838317511145591_test_basic.base ............ [INSERT 10 in 0.27s]
22:50:32
22:50:32 Finished running 1 seed in 0 hours 0 minutes and 0.34 seconds (0.34s).
22:50:32
22:50:32 Completed successfully
22:50:32
22:50:32 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1
Invoking dbt with ['run']
22:50:32 Running with dbt=1.6.2
22:50:32 Registered adapter: starrocks=1.4.2
22:50:32 Found 3 models, 1 seed, 1 source, 0 exposures, 0 metrics, 335 macros, 0 groups, 0 semantic models
22:50:32
22:50:32 Concurrency: 1 threads (target='default')
22:50:32
22:50:32 1 of 2 START sql table model test17102838317511145591_test_basic.table_model ... [RUN]
22:50:32 Unhandled error while executing
Field "type" of type Optional[StarRocksRelationType] in StarRocksRelation has invalid value 'cte'
22:50:32 1 of 2 ERROR creating sql table model test17102838317511145591_test_basic.table_model [ERROR in 0.01s]
22:50:32 2 of 2 START sql view model test17102838317511145591_test_basic.view_model ..... [RUN]
22:50:32 Unhandled error while executing
Field "type" of type Optional[StarRocksRelationType] in StarRocksRelation has invalid value 'cte'
22:50:32 2 of 2 ERROR creating sql view model test17102838317511145591_test_basic.view_model [ERROR in 0.00s]
22:50:32
22:50:32 Finished running 1 table model, 1 view model in 0 hours 0 minutes and 0.06 seconds (0.06s).
22:50:32
22:50:32 Completed with 2 errors and 0 warnings:
22:50:32
22:50:32 Field "type" of type Optional[StarRocksRelationType] in StarRocksRelation has invalid value 'cte'
22:50:32
22:50:32 Field "type" of type Optional[StarRocksRelationType] in StarRocksRelation has invalid value 'cte'
22:50:32
22:50:32 Done. PASS=0 WARN=0 ERROR=2 SKIP=0 TOTAL=2
=========================== short test summary info ============================
FAILED tests/functional/adapter/test_basic.py::TestEphemeralMyAdapter::test_ephemeral
============================== 1 failed in 1.33s ===============================
Finished running tests!
alberttwong commented