Skip to content

Fix MetaData schema specification in SQLAlchemy tests#593

Merged
laughingman7743 merged 2 commits into
masterfrom
feature/fix-test-schema-specification
Aug 3, 2025
Merged

Fix MetaData schema specification in SQLAlchemy tests#593
laughingman7743 merged 2 commits into
masterfrom
feature/fix-test-schema-specification

Conversation

@laughingman7743
Copy link
Copy Markdown
Member

Summary

  • Fix MetaData schema specification by adding schema=ENV.schema parameter to 6 test methods
  • Remove TODO comments that were requesting schema specification
  • Ensure proper test isolation and consistency across test environments

Changes

  • test_reflect_table: Add schema to MetaData for one_row table
  • test_reflect_table_include_columns: Add schema to MetaData for one_row_complex table
  • test_partition_table_columns: Add schema to MetaData for partition_table
  • test_get_table_names: Add schema to MetaData for table reflection
  • test_get_view_names: Add schema to MetaData for view reflection
  • test_create_table: Add schema to MetaData for table creation

Test plan

  • All existing tests continue to pass
  • Code quality checks (lint, format, type) pass
  • No functional changes, only schema specification improvements

This PR addresses TODO comments that were added to identify missing schema specifications in test metadata.

🤖 Generated with Claude Code

Add schema=ENV.schema parameter to MetaData() instances that were
missing explicit schema specification. This ensures proper test
isolation and consistency across test environments.

Changes:
- test_reflect_table: Add schema to MetaData for one_row table
- test_reflect_table_include_columns: Add schema to MetaData for one_row_complex table
- test_partition_table_columns: Add schema to MetaData for partition_table
- test_get_table_names: Add schema to MetaData for table reflection
- test_get_view_names: Add schema to MetaData for view reflection
- test_create_table: Add schema to MetaData for table creation

All TODO comments regarding schema specification have been resolved.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@laughingman7743 laughingman7743 marked this pull request as draft August 3, 2025 07:36
When MetaData is initialized with a schema parameter, SQLAlchemy uses
schema-qualified table names (e.g., "schema.table_name") as keys in
meta.tables dictionary.

Update test_get_table_names and test_get_view_names to use proper
schema-qualified names when checking for table presence in reflected
metadata.

Fixes CI test failures caused by schema specification changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@laughingman7743 laughingman7743 marked this pull request as ready for review August 3, 2025 09:00
@laughingman7743 laughingman7743 merged commit b770b8d into master Aug 3, 2025
5 checks passed
@laughingman7743 laughingman7743 deleted the feature/fix-test-schema-specification branch August 3, 2025 09:00
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.

1 participant