Skip to content

Whitespace cleanup: concat/current_timestamp/date_trunc/surrogate_key #196

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

Closed
wants to merge 1 commit into from

Conversation

Limess
Copy link
Contributor

@Limess Limess commented Mar 12, 2020

Minor change to remove extraneous whitespace from concat/current_timestamp/date_trunc/surrogate_key macros.

Mainly actioned to reduce the vertical space taken up by surrogate_key, which we use almost everywhere, in the DBT compiled docs view.

Surrogate key test before:

select
    

    
        
    

    
        
    

    md5(cast(
  concat(coalesce(cast(field_1 as 
    varchar
), ''), '-', coalesce(cast(field_2 as 
    varchar
), ''), '-', coalesce(cast(field_3 as 
    varchar
), ''))
 as 
    varchar
)) as actual,
    expected

Surrogate key test after:

select
    md5(cast(concat(coalesce(cast(field_1 as 
    varchar
), ''), '-', coalesce(cast(field_2 as 
    varchar
), ''), '-', coalesce(cast(field_3 as 
    varchar
), '')) as 
    varchar
)) as actual,
    expected

This could still be much improved (not newlining types) but I'm unsure if that would break some scenarios in any SQL dialect supported by this package.

@clrcrl
Copy link
Contributor

clrcrl commented Mar 20, 2020

Closing in favor of #199 due to merge conflict

@clrcrl clrcrl closed this Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants