Skip to content

Fix Snowflake FK metadata parent/child direction#12255

Merged
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
ianu82:codex/fix-snowflake-fk-parent-child-mapping
Mar 20, 2026
Merged

Fix Snowflake FK metadata parent/child direction#12255
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
ianu82:codex/fix-snowflake-fk-parent-child-mapping

Conversation

@ianu82

@ianu82 ianu82 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix meta_get_foreign_keys column renaming so Snowflake PK columns map to parent_* and FK columns map to child_*
  • extend the unit test to assert actual parent/child table+column values, not only column presence

Why

SHOW IMPORTED KEYS returns primary-key metadata in pk_* columns and foreign-key metadata in fk_* columns. The previous rename inverted this relationship, producing reversed lineage in the catalog.

Validation

  • python3 -m py_compile mindsdb/integrations/handlers/snowflake_handler/snowflake_handler.py tests/unit/handlers/test_snowflake.py
  • pytest -q tests/unit/handlers/test_snowflake.py -k meta_get_foreign_keys_filters (fails in this environment due to missing optional dependency appdirs)

@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@StpMax StpMax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't check it, but looks convincing.
Will be also good to change columns names in the test

@StpMax StpMax changed the base branch from main to releases/26.1.0 March 20, 2026 09:33
@StpMax StpMax merged commit a01c807 into mindsdb:releases/26.1.0 Mar 20, 2026
28 of 33 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants