Skip to content

fix: foreign keys accept self-referential and circular foreign keys#1750

Merged
pierrecamilleri merged 7 commits intomainfrom
fix/circular-foreign-key
Apr 8, 2026
Merged

fix: foreign keys accept self-referential and circular foreign keys#1750
pierrecamilleri merged 7 commits intomainfrom
fix/circular-foreign-key

Conversation

@pierrecamilleri
Copy link
Copy Markdown
Collaborator

@pierrecamilleri pierrecamilleri commented Jul 15, 2025


Foreign keys are implemented by building a lookup for the referenced resources. This lookup creation opens and closes the resource, which should therefore be a copy to not interfere with other processes manipulating the resource.

Unit tests for explicit and implicit self-referencing, and circular foreign keys have been added.

CI debug session
  • Trying to reproduce locally
    • default env has no test fail
    • hatch --env ci.py3.11 shell reproduces the test fail

Looks like a message previously echoed to stdout is now outputed to stderr.
Behavior observed with click 8.2.1 and typer 0.16.0

Default environment (no test fail) has click 8.1.8 and typer 0.15.2

Click 8.2 has removed support for py3.8 and py3.9 which would explain that the tests still pass in ci.3.{8,9} environments.

Ok, here is the breaking change of click 8.2 : pallets/click#2522

@pierrecamilleri pierrecamilleri force-pushed the fix/circular-foreign-key branch from 46dbbb9 to 4536509 Compare July 21, 2025 07:11
@pierrecamilleri pierrecamilleri force-pushed the fix/circular-foreign-key branch from 4536509 to 05b7036 Compare July 21, 2025 07:44
@pierrecamilleri pierrecamilleri merged commit 2497ce4 into main Apr 8, 2026
9 checks passed
@pierrecamilleri pierrecamilleri deleted the fix/circular-foreign-key branch April 8, 2026 08:19
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.

Circular Foreign Key Causes "Resource Is Not Open" Exception in Frictionless

1 participant