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

Feature/model aliasing #771

Closed
wants to merge 17 commits into from

Conversation

jon-rtr
Copy link
Contributor

@jon-rtr jon-rtr commented May 12, 2018

I took @abelsonlive 's great PR #651 and merged it on top of the development branch, yesterday (i.e. 0.10.1rc2). I tried to address issues that popped up. While the unit and quick tests pass, I have not tested it against my snowflake databse yet.

$ git merge kickstarter/feature/model-aliasing
CONFLICT (content): Merge conflict in dbt/utils.py
CONFLICT (modify/delete): dbt/include/global_project/macros/materializations/table.sql deleted in HEAD and modified in kickstarter/feature/model-aliasing. Version kickstarter/feature/model-aliasing of dbt/include/global_project/macros/materializations/table.sql left in tree.
CONFLICT (modify/delete): dbt/include/global_project/macros/materializations/bigquery.sql deleted in HEAD and modified in kickstarter/feature/model-aliasing. Version kickstarter/feature/model-aliasing of dbt/include/global_project/macros/materializations/bigquery.sql left in tree.

  1. dbt/utils.py

    Some major changes are being introduced in 0.10.1: Implement relations api (Implement relations api #727)
    Implement relations api #727
    5344f54#diff-196bbfafed32edaf1554550f65111f87

    The Relation class was extracted into ...
    ./dbt/api/object.py class APIObject(dict)
    ./dbt/adapters/default/relation.py class DefaultRelation(APIObject)
    ./dbt/adapters/bigquery/relation.py class BigQueryRelation(DefaultRelation)
    ./dbt/adapters/snowflake/relation.py class SnowflakeRelation(DefaultRelation)

    Changing node.get('name') to node.get('alias') ...
    ./dbt/adapters/default/relation.py
    ./dbt/adapters/bigquery/relation.py
    ./dbt/adapters/snowflake/relation.py

  2. dbt/include/global_project/macros/materializations/table.sql

    This was renamed to ...
    ./dbt/include/global_project/macros/materializations/table/table.sql

  3. dbt/include/global_project/macros/materializations/bigquery.sql

    This was split into ...
    ./dbt/include/global_project/macros/materializations/table/bigquery_table.sql
    and ...
    ./dbt/include/global_project/macros/materializations/view/bigquery_view.sql

  4. other instances of model['name']

    The following file also mention model['name'] and probably need to change as well ...

    ./dbt/include/global_project/macros/materializations/archive/archive.sql
    ./dbt/include/global_project/macros/materializations/seed/bigquery.sql
    ./dbt/include/global_project/macros/materializations/seed/seed.sql

    Added comentary to ...

    ./dbt/exceptions.py

  5. further changes

    Revert model.get('alias') to model.get('name') ...
    print_test_result_line in ./dbt/ui/printer.py (since in this context schema is NOT being used)

    Change model.get('name') to model.get('alias') ...
    print_seed_result_line in ./dbt/ui/printer.py (since in this context schema is also being used)

    Change node.get('name') to node.get('alias') ...
    _node_context in ./dbt/node_runners.py (since in this context schema is also being used)
    call_get_missing_columns in ./dbt/node_runners.py (since in this context schema is also being used)
    call_already_exists in ./dbt/node_runners.py (since in this context schema is also being used)

  6. linting

    import lines must be under 80 characters
    https://www.python.org/dev/peps/pep-0328/

Brian Abelson and others added 17 commits February 6, 2018 15:39
…o model-aliasing

$ git merge kickstarter/feature/model-aliasing
CONFLICT (content): Merge conflict in dbt/utils.py
CONFLICT (modify/delete): dbt/include/global_project/macros/materializations/table.sql deleted in HEAD and modified in kickstarter/feature/model-aliasing. Version kickstarter/feature/model-aliasing of dbt/include/global_project/macros/materializations/table.sql left in tree.
CONFLICT (modify/delete): dbt/include/global_project/macros/materializations/bigquery.sql deleted in HEAD and modified in kickstarter/feature/model-aliasing. Version kickstarter/feature/model-aliasing of dbt/include/global_project/macros/materializations/bigquery.sql left in tree.

1. dbt/utils.py

   Some major changes are being introduced in 0.10.1: Implement relations api (dbt-labs#727)
   dbt-labs#727
   dbt-labs@5344f54#diff-196bbfafed32edaf1554550f65111f87

   The Relation class was extracted into ...
   ./dbt/api/object.py                   class APIObject(dict)
   ./dbt/adapters/default/relation.py    class DefaultRelation(APIObject)
   ./dbt/adapters/bigquery/relation.py   class BigQueryRelation(DefaultRelation)
   ./dbt/adapters/snowflake/relation.py  class SnowflakeRelation(DefaultRelation)

   Changing node.get('name') to node.get('alias') ...
   ./dbt/adapters/default/relation.py
   ./dbt/adapters/bigquery/relation.py
   ./dbt/adapters/snowflake/relation.py

2. dbt/include/global_project/macros/materializations/table.sql

   This was renamed to ...
   ./dbt/include/global_project/macros/materializations/table/table.sql

3. dbt/include/global_project/macros/materializations/bigquery.sql

   This was split into ...
   ./dbt/include/global_project/macros/materializations/table/bigquery_table.sql
   and ...
   ./dbt/include/global_project/macros/materializations/view/bigquery_view.sql

4. other instances of model['name']

   The following file also mention model['name'] and probably need to change as well ...

   ./dbt/include/global_project/macros/materializations/archive/archive.sql
   ./dbt/include/global_project/macros/materializations/seed/bigquery.sql
   ./dbt/include/global_project/macros/materializations/seed/seed.sql

   Added comentary to ...

   ./dbt/exceptions.py

5. further changes

   Revert model.get('alias') to model.get('name') ...
   print_test_result_line in ./dbt/ui/printer.py (since in this context schema is NOT being used)

   Change model.get('name') to model.get('alias') ...
   print_seed_result_line in ./dbt/ui/printer.py (since in this context schema is also being used)

   Change node.get('name') to node.get('alias') ...
   _node_context in ./dbt/node_runners.py (since in this context schema is also being used)
   call_get_missing_columns in ./dbt/node_runners.py (since in this context schema is also being used)
   call_already_exists in ./dbt/node_runners.py (since in this context schema is also being used)

6. linting

   import lines must be under 80 characters
   https://www.python.org/dev/peps/pep-0328/
@drewbanin drewbanin mentioned this pull request Jun 18, 2018
@drewbanin drewbanin closed this Jun 18, 2018
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.

3 participants