Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Derived quoting does not work #16

Open
aurany opened this issue Feb 22, 2021 · 2 comments
Open

Derived quoting does not work #16

aurany opened this issue Feb 22, 2021 · 2 comments

Comments

@aurany
Copy link

aurany commented Feb 22, 2021

My adapter (DB2) has the default False-True-True quoting setting which is configured in the adapter implementation. I am not using any other setting for quotings in the spec-file. When running the tests the quoting gets overwritten by the function _relation_from_name. So when I run with False-True-True it becomes False-True-False and the tests fails (because DB2 tries to use tables that doesn't exist).

It looks like the tables are created correctly with all lowercase names, but when some tests take place they fail. I am pretty sure the error occur in test 2 ("base") step 6 ("relation_rows") when running "select count(*) from {relation}" (see below) because the relation identifier is rendered without quoting (=> uppercase in DB2).

https://github.com/fishtown-analytics/dbt-adapter-tests/blob/a411336e9493a38c228a876e19af24d70ec53d86/pytest_dbt_adapter/spec_file.py#L453-L465

When running the tests with a forked version of this repo (_relation_from_name is only returning the default quoting) all tests pass :) My suggestion is to use the adapter default setting only. Good idea?

@jtcohen6
Copy link
Contributor

@aurany Appreciate the detailed writeup! What's the change you made in your fork to get this working? I imagine it's a tweak to _relation_from_name here:

https://github.com/fishtown-analytics/dbt-adapter-tests/blob/a411336e9493a38c228a876e19af24d70ec53d86/pytest_dbt_adapter/spec_file.py#L186-L204

@aurany
Copy link
Author

aurany commented Feb 23, 2021

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants