Skip to content

Fix seed not respecting alias config#671

Open
lawofcycles wants to merge 2 commits intoaws-samples:mainfrom
lawofcycles:fix/seed-alias-not-respected
Open

Fix seed not respecting alias config#671
lawofcycles wants to merge 2 commits intoaws-samples:mainfrom
lawofcycles:fix/seed-alias-not-respected

Conversation

@lawofcycles
Copy link
Copy Markdown
Contributor

@lawofcycles lawofcycles commented Mar 14, 2026

resolves #535

Description

The alias configuration for seeds was not being respected. When a seed had alias: location configured, 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_code in impl.py, where model["name"] was used to build the table name, table existence check, S3 path, and verification query. This has been changed to model["alias"], which is the correct field for determining the table name in dbt. When no alias is configured, dbt automatically sets alias equal to name, so this change is backward compatible.

Changes

  • dbt/adapters/glue/impl.py: Replace model["name"] with model["alias"] in 4 places within _map_csv_chunks_to_code
  • tests/unit/test_adapter.py: Add "alias" key to existing test model dicts, and add a new test test_create_csv_table_uses_alias_for_table_name that verifies the alias is used instead of the name

Tested with unit tests (51 passed) and verified on a live AWS Glue environment that the seed table is created with the alias name.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and 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.

… model[name] for table name

Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
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.

glue adapter not respecting alias

1 participant