You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the provided package.yaml file to configure the Frictionless package.
Run the test code to open the foo resource.
Observe that the operation fails immediately with the following traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../venv/lib/python3.12/site-packages/frictionless/resources/table.py", line 171, in open
self.__open_lookup()
File ".../venv/lib/python3.12/site-packages/frictionless/resources/table.py", line 263, in __open_lookup
with source_res:
File ".../venv/lib/python3.12/site-packages/frictionless/resource/resource.py", line 261, in __enter__
self.open()
File ".../venv/lib/python3.12/site-packages/frictionless/resources/table.py", line 171, in open
self.__open_lookup()
File ".../venv/lib/python3.12/site-packages/frictionless/resources/table.py", line 264, in __open_lookup
for row in source_res.row_stream: # type: ignore
^^^^^^^^^^^^^^^^^^^^^
File ".../venv/lib/python3.12/site-packages/frictionless/resources/table.py", line 138, in row_stream
raise FrictionlessException("resource is not open")
frictionless.exception.FrictionlessException: [error] resource is not open
Expected Behavior:
The resource should open successfully, even when it has circular foreign key references.
Observed Behavior:
An exception is raised immediately when trying to open the resource, indicating that the resource is not open due to the circular reference.
Possible Cause:
The issue may relate to how Frictionless manages resource lifecycles when dealing with circular foreign key references. Specifically, it appears that the resource cannot open itself properly when it references another resource that refers back to it.
Environment:
Frictionless version: 5.18.0
The text was updated successfully, but these errors were encountered:
ipimpat
changed the title
Circular Foreign Key Causes "Resource Is Not Open" Exception in Frictionless
MySQL: Circular Foreign Key Causes "Resource Is Not Open" Exception in Frictionless
Jan 14, 2025
I encountered an issue when trying to open a resource in Frictionless that has a circular foreign key relationship with another resource.
The operation fails immediately with a
FrictionlessException: [error] resource is not open
.Database Structure:
The database consists of two tables,
foo
andbar
, which reference each other through foreign keys:Test package.yaml File:
Test Code:
Steps to Reproduce:
package.yaml
file to configure the Frictionless package.foo
resource.Expected Behavior:
The resource should open successfully, even when it has circular foreign key references.
Observed Behavior:
An exception is raised immediately when trying to open the resource, indicating that the resource is not open due to the circular reference.
Possible Cause:
The issue may relate to how Frictionless manages resource lifecycles when dealing with circular foreign key references. Specifically, it appears that the resource cannot open itself properly when it references another resource that refers back to it.
Environment:
The text was updated successfully, but these errors were encountered: