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

update to allow adapters to change model name resolution in py models #7115

Merged
merged 5 commits into from
Mar 8, 2023

Conversation

colin-rogers-dbt
Copy link
Contributor

resolves #7114

Description

Checklist

Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -1,9 +1,19 @@
{% macro resolve_model_name(input_model_name) %}

{{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually the first time I see dispatch being implemented since I join

@colin-rogers-dbt colin-rogers-dbt merged commit c02ddf8 into main Mar 8, 2023
@colin-rogers-dbt colin-rogers-dbt deleted the addPyRelationNameMacro branch March 8, 2023 23:33
@github-actions
Copy link
Contributor

The backport to 1.4.latest failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.4.latest 1.4.latest
# Navigate to the new working tree
cd .worktrees/backport-1.4.latest
# Create a new branch
git switch --create backport-7115-to-1.4.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c02ddf8c0ea84f25298bad35c99ed04a030d89e4
# Push it to GitHub
git push --set-upstream origin backport-7115-to-1.4.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.4.latest

Then, create a pull request where the base branch is 1.4.latest and the compare/head branch is backport-7115-to-1.4.latest.

peterallenwebb pushed a commit that referenced this pull request Mar 14, 2023
…#7115)

* update to allow adapters to change model name resolution in py models

* add changie

* fix newline adds

* move quoting into macro

* use single quotes
peterallenwebb added a commit that referenced this pull request Mar 22, 2023
* ct-2198: clean up some type names and uses

* CT-2198: Unify constraints and constraints_check properties on columns

* Make mypy version consistently 0.981 (#7134)

* CT 1808 diff based partial parsing (#6873)

* model contracts on models materialized as views (#7120)

* first pass

* rename tests

* fix failing test

* changelog

* fix functional test

* Update core/dbt/parser/base.py

* Update core/dbt/parser/schemas.py

* Create method for env var deprecation (#7086)

* update to allow adapters to change model name resolution in py models (#7115)

* update to allow adapters to change model name resolution in py models

* add changie

* fix newline adds

* move quoting into macro

* use single quotes

* add env DBT_PROJECT_DIR support #6078 (#6659)

Co-authored-by: Jeremy Cohen <[email protected]>

* Add new index.html and changelog yaml files from dbt-docs (#7141)

* Make version configs optional (#7060)

* [CT-1584] New top level commands: interactive compile (#7008)

Co-authored-by: Github Build Bot <[email protected]>

* CT-2198: Add changelog entry

* CT-2198: Fix tests which broke after merge

* CT-2198: Add explicit validation of constraint types w/ unit test

* CT-2198: Move access property, per code review

* CT-2198: Remove a redundant macro

* CT-1298: Rework constraints to be adapter-generated in Python code

* CT-2198: Clarify function name per review

---------

Co-authored-by: Gerda Shank <[email protected]>
Co-authored-by: Emily Rockman <[email protected]>
Co-authored-by: Stu Kilgore <[email protected]>
Co-authored-by: colin-rogers-dbt <[email protected]>
Co-authored-by: Leo Schick <[email protected]>
Co-authored-by: Jeremy Cohen <[email protected]>
Co-authored-by: FishtownBuildBot <[email protected]>
Co-authored-by: dave-connors-3 <[email protected]>
Co-authored-by: Kshitij Aranke <[email protected]>
Co-authored-by: Github Build Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2265] [Feature] Allow adapters to overwrite python model name resolution
3 participants