-
Notifications
You must be signed in to change notification settings - Fork 107
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
Source for specific tables #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for putting this together @rahulj51 ! 💪
Nice work putting together the integration tests too.
I've left comments for some very small updates. They are small enough that I will try merging them. I'll reach out to you if I need your help on those.
macros/generate_source.sql
Outdated
@@ -14,7 +14,7 @@ | |||
|
|||
|
|||
--- | |||
{% macro generate_source(schema_name, database_name=target.database, generate_columns=False, include_descriptions=False) %} | |||
{% macro generate_source(schema_name, database_name=target.database, table_names=None, generate_columns=False, include_descriptions=False) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sliding to the end of the signature so that it isn't a breaking change for anyone using positional arguments (rather than keyword arguments):
{% macro generate_source(schema_name, database_name=target.database, table_names=None, generate_columns=False, include_descriptions=False) %} | |
{% macro generate_source(schema_name, database_name=target.database, generate_columns=False, include_descriptions=False, table_names=none) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rahulj51 thank you again for adding this feature 🏅
It all looks good, and it will be included in the next release.
* Addig another parameter to pass a list of tables to generate_source * Addig another parameter to pass a list of tables to generate_source * Updated README * Updated changelog * Apply suggestions from code review * Update integration_tests/tests/test_generate_source_some_tables.sql Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com>
This is a:
main
dev/
branchdev/
branchDescription & motivation
Resolves #50
By default,
generate_source
generates the source definitions for all tables in a schema. With very big schemas, sometimes, you only wish to generate the schema for a selected set of tables. This PR adds an optional arg calledtable_names
togenerate_source
that takes a list of tables.Note on Testing
The instructions for testing locally were not clear but with some trial and error, the following steps were performed to run the integration tests
integration_tests
create_source_table
operation usingrun-operation
from console.dbt sed
to create the...raw_data
schema and thedata__a_relation
table within.Also tested on a real-life dbt project by including the package locally and running the
generate_source
command.Checklist