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

107 generic function operation #111

Merged
merged 14 commits into from
Apr 12, 2024
Merged

107 generic function operation #111

merged 14 commits into from
Apr 12, 2024

Conversation

Abhishek-N
Copy link
Contributor

No description provided.

@Abhishek-N Abhishek-N linked an issue Apr 11, 2024 that may be closed by this pull request
@Abhishek-N Abhishek-N requested a review from fatchat April 12, 2024 08:34
@fatchat
Copy link
Contributor

fatchat commented Apr 12, 2024

sql, len_output_set = generic.generic_function_dbt_sql({
    "input": {
        "input_type": "model",
        "source_name": "intermediate",
        "input_name": "pivot",
    },
    "source_columns": ["c1", "c2", "c3"],
    "dest_schema": "schema", "output_model_name": "modelname",
    "computed_columns": [
             {"function_name": "UPPER", "operands": [{"value": "small", "is_col": True}], "output_column_name": "maxval"},
    ]
}, wc_client)

gives the query

SELECT "c1", "c2", "c3", UPPER('"small"') AS maxval FROM {{ref('pivot')}}

But this isn't right, the single-quotes around "small" tell postgres to treat it as a constant instead of as a column name

@fatchat fatchat merged commit 648f7f5 into main Apr 12, 2024
1 check failed
@fatchat fatchat deleted the 107-generic-function-operation branch April 12, 2024 16:44
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.

generic function operation
2 participants