Fix seed not respecting alias config#671
Open
lawofcycles wants to merge 2 commits intoaws-samples:mainfrom
Open
Fix seed not respecting alias config#671lawofcycles wants to merge 2 commits intoaws-samples:mainfrom
lawofcycles wants to merge 2 commits intoaws-samples:mainfrom
Conversation
… model[name] for table name Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #535
Description
The
aliasconfiguration for seeds was not being respected. When a seed hadalias: locationconfigured, the table was still created with the original seed name (e.g.,seed_location) instead of the alias (location).The root cause was in
_map_csv_chunks_to_codeinimpl.py, wheremodel["name"]was used to build the table name, table existence check, S3 path, and verification query. This has been changed tomodel["alias"], which is the correct field for determining the table name in dbt. When no alias is configured, dbt automatically setsaliasequal toname, so this change is backward compatible.Changes
dbt/adapters/glue/impl.py: Replacemodel["name"]withmodel["alias"]in 4 places within_map_csv_chunks_to_codetests/unit/test_adapter.py: Add"alias"key to existing test model dicts, and add a new testtest_create_csv_table_uses_alias_for_table_namethat verifies the alias is used instead of the nameTested with unit tests (51 passed) and verified on a live AWS Glue environment that the seed table is created with the alias name.
Checklist
CHANGELOG.mdand added information about my change to the "dbt-glue next" section.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.