Skip to content

feat: Filter temporary _next schemas during inspection#14

Closed
lpillmann wants to merge 1 commit intomainfrom
cyrus/gem-5-intermitent-snowflake-schemas-_next-or-_next-should-be
Closed

feat: Filter temporary _next schemas during inspection#14
lpillmann wants to merge 1 commit intomainfrom
cyrus/gem-5-intermitent-snowflake-schemas-_next-or-_next-should-be

Conversation

@lpillmann
Copy link
Copy Markdown
Collaborator

@lpillmann lpillmann commented Feb 21, 2026

Summary

Fixes intermittent errors caused by temporary Snowflake schemas with _next suffix being included in permifrost inspection. Our ingestion framework creates schemas with _next suffix that may disappear between when tundri starts and when permifrost executes, causing object not exists errors.

Problem

Tundri inspects Snowflake schemas and passes them to permifrost for permission management. Temporary _next schemas created by the ingestion framework are ephemeral — they exist when inspection runs but may be gone by the time permifrost processes them.

Solution

Filter out schemas ending with _next (case-insensitive) in tundri's inspect_schemas() function so they never enter the execution pipeline.

Changes

  • tundri/inspector.py — Added filtering in inspect_schemas() to skip schemas ending with _NEXT (case-insensitive via .upper().endswith("_NEXT"))
  • tests/test_inspector.py — Added comprehensive unit test covering _next, _NEXT, and _Next variants

Testing

  • All unit tests passing
  • New test verifies uppercase, lowercase, and mixed-case _next suffixes are all filtered

Related

Note

This PR adds filtering on the tundri side. The root fix is in permifrost#11 where the error originates. Both changes work together to fully resolve the issue.

Add filtering logic to ignore Snowflake schemas ending with _next or
_NEXT (case-insensitive) to prevent race condition errors when these
temporary schemas disappear between inspection and execution.

- Add filtering in inspect_schemas() function
- Add comprehensive unit tests for filtering logic
- Fix code formatting in cli.py and utils.py

Resolves GEM-5

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Package published to TestPyPI!

You can test the installation with:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ tundri==1.3.4

View package: https://test.pypi.org/project/tundri/1.3.4/

@lpillmann lpillmann marked this pull request as ready for review February 21, 2026 02:10
@lpillmann lpillmann changed the title Filter temporary _next schemas during inspection feat: Filter temporary _next schemas during inspection Feb 21, 2026
@lpillmann
Copy link
Copy Markdown
Collaborator Author

Closing as the fix is being handled in the permifrost repository instead (Gemma-Analytics/permifrost#11).

@lpillmann lpillmann closed this Feb 21, 2026
@lpillmann lpillmann deleted the cyrus/gem-5-intermitent-snowflake-schemas-_next-or-_next-should-be branch March 13, 2026 21:03
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