fix: import only the tables that CREATE TABLE statements create - #1530
Open
ReguiguiMohamed wants to merge 1 commit into
Open
fix: import only the tables that CREATE TABLE statements create#1530ReguiguiMohamed wants to merge 1 commit into
ReguiguiMohamed wants to merge 1 commit into
Conversation
The SQL importer collected every table node under a CREATE statement, so a CREATE SCHEMA reached the loop that reads a table name and raised AttributeError: 'NoneType' object has no attribute 'name'. Any DDL file that creates its schema before its tables failed to import. It now reads the target of each CREATE TABLE. That also drops the empty schema objects a CREATE DATABASE or CREATE VIEW produced, and the duplicates their query sources produced.
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.
datacontract import sqlfailed withAttributeError: 'NoneType' object has no attribute 'name'on any DDL file containingCREATE SCHEMA.The importer collected every table node beneath a
CREATErather than the table eachCREATE TABLEcreates, andCREATE SCHEMA salesparses to a table node with no table name. It now reads the target of eachCREATE TABLE, which also drops the empty schema objectsCREATE DATABASEandCREATE VIEWproduced, and the duplicates from their query sources.Fixes #1529
uv run pytest)uv run ruff check --fix && uv run ruff format)The four
test_import_sql_*files pass. The full suite matchesmain, with one extra pass for the new test; the remaining failures are optional extras and Docker missing locally.