Skip to content

Bug: Tables with AttributeAdapter columns raise AssertionError: Declaration context is not set #1278

@zhenruiliao

Description

@zhenruiliao

Bug Report

Description

Tables with AttributeAdapter columns raise AssertionError: Declaration context is not set on attempting to drop and when used as foreign keys. This seems to be because context is not passed down from origin table to FreeTable when it is created internally

Reproducibility

Include:

  • OS (WIN | MACOS | Linux)
  • Python Version 3.14
  • MySQL Version Mariadb 12.0.2
  • MySQL Deployment Strategy local-native
  • DataJoint Version '0.14.6'
  • dj-attributeadapter-test.py

Expected Behavior

Normal drop and foreign key behavior

Additional Research and Context

I have created a fork in which I simply pass context down to FreeTable, which seems to resolve the issue
Is there any reason not to pass context down?
https://github.com/zhenruiliao/datajoint-python/tree/pass-context-down-to-freetable

Metadata

Metadata

Labels

bugIndicates an unexpected problem or unintended behaviortriageIndicates issues, pull requests, or discussions need to be reviewed for the first time

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions