Skip to content

0.13.dev2 duplicate-attribute join issue #857

@ixcat

Description

@ixcat

Bug Report

Description

Testing 0.13.dev2 query engine yielded an unexpected exception when restricting on tables with duplicate fields

Reproducibility

>>> print(lab.Subject().definition)
   subject_id          : int   # institution 6 digit animal ID
   ---
   -> [nullable] Person        # person responsible for the animal
   cage_number         : int   # institution 6 digit animal ID
   date_of_birth       : date  # format: yyyy-mm-dd
   sex                 : enum('M','F','Unknown')
   -> [nullable] AnimalSource  # where was the animal ordered from
>>> print(lab.WaterRestriction().definition)
   -> Subject
   ---
   water_restriction_number    : varchar(16)   # WR number
   cage_number                 : int
   wr_start_date               : date
   wr_start_weight             : Decimal(6,3)
>>> lab.WaterRestriction() * lab.Subject().proj()
...
pymysql.err.OperationalError: (1052, "Column 'cage_number' in field
 list is ambiguous")

Expected Behavior

This previously allowed joining on the projected lab.Subject

Metadata

Metadata

Labels

bugIndicates an unexpected problem or unintended behavior

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions