Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't force quoted identifiers #644

Closed
1 of 5 tasks
kylebutler-sf opened this issue Aug 19, 2022 · 3 comments · Fixed by #706
Closed
1 of 5 tasks

Shouldn't force quoted identifiers #644

kylebutler-sf opened this issue Aug 19, 2022 · 3 comments · Fixed by #706
Assignees
Labels
bug Something isn't working good first issue Hackathon Coalesce Hackathon Submissions

Comments

@kylebutler-sf
Copy link

Describe the bug

Adapter.quote is used in many places in this package which forces quoted identifiers. My specific use case is with "star" in which case it will quote all of the columns. Depending on the target system this can cause quoted identifiers to be required to query columns generated by dbt.

Steps to reproduce

with source as (

    select * from {{ source('_lenel__sources', 'accesspane') }}

),

renamed as (

    select
        name as panel_name,
        panelid as panel_id,
        daylightsave as daylight_savings,
        paneltype as panel_type,
        panelnum as panel_number,
        paneltz as panel_timezone,
        audit_etl_job_ins_key as etl_insert_key,
        audit_etl_job_upd_key as etl_update_key,
        audit_etl_job_ins_ts as etl_inserted_at,
        audit_etl_job_upd_ts as etl_updated_at,
        table_processing_datetime as table_processed_at,
        {{ dbt_utils.star(
            from=source('_lenel__sources', 'accesspane'),
            except=["name", "panelid", "daylightsave", "paneltype", "panelnum", "paneltz", "audit_etl_job_ins_key", "audit_etl_job_upd_key", "audit_etl_job_ins_ts","audit_etl_job_upd_ts","table_processing_datetime"],
            prefix='panel_'
        )|lower }}

    from source

)

select * from renamed

All columns expanded by star will be quoted

Expected results

We would expect this to respect the settings of the project.

baudrate as panel_baudrate,
comport as panel_comport,
terminalna as panel_terminalna,
cardholdsz as panel_cardholdsz,
cardtype as panel_cardtype,
pintype as panel_pintype,

Actual results

"baudrate" as "panel_baudrate",
"comport" as "panel_comport",
"terminalna" as "panel_terminalna",
"cardholdsz" as "panel_cardholdsz",
"cardtype" as "panel_cardtype",
"pintype" as "panel_pintype",

System information

The contents of your packages.yml file:

packages:
  - package: dbt-labs/codegen
    version: 0.7.0
  - package: dbt-labs/dbt_utils
    version: 0.8.6

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

➜ dbt --version
Core:
  - installed: 1.1.0
  - latest:    1.2.0 - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - bigquery:  1.1.0 - Update available!
  - snowflake: 1.1.0 - Update available!

Are you interested in contributing the fix?

Slightly outside my wheelhouse, though I'm interested in the resolution.

@kylebutler-sf kylebutler-sf added bug Something isn't working triage labels Aug 19, 2022
@joellabes
Copy link
Contributor

I empathise with the problem you describe! If you or another community member wants to change it to a configurable behaviour, I'd welcome a PR in that direction 👍

@dbeatty10 dbeatty10 added the Hackathon Coalesce Hackathon Submissions label Oct 17, 2022
@Doctacon
Copy link
Contributor

Doctacon commented Oct 17, 2022

I got this! Working on it in the Hackathon #Coalesce
PR Request: #706

@joellabes
Copy link
Contributor

Resolved by #706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Hackathon Coalesce Hackathon Submissions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants