Skip to content

delete error in 0.13dev5 #883

@shenshan

Description

@shenshan

Bug Report

Description

Got an error when deleting an upstream table in princeton pipeline

Reproducibility

Include:

  • OS Linux
  • Python Version 3.7.3
  • MySQL Version MySQL 5.5.5-10.2.22-MariaDB
  • MySQL Deployment Strategy (local-native)
  • DataJoint Version 0.13dev5

Error message:

DataJointError                            Traceback (most recent call last)
<ipython-input-6-1a87e0503527> in <module>
----> 1 scan_element.Scan.delete()

~/anaconda3/envs/imaging_element/lib/python3.7/site-packages/datajoint/table.py in delete(self, transaction, safemode)
    395         # Cascading delete
    396         try:
--> 397             delete_count = self._delete_cascade()
    398         except:
    399             if transaction:

~/anaconda3/envs/imaging_element/lib/python3.7/site-packages/datajoint/table.py in _delete_cascade(self)
    364                 else:
    365                     child &= self.proj()
--> 366                 delete_count += child._delete_cascade()
    367             else:
    368                 print("Deleting {count} rows from {table}".format(

~/anaconda3/envs/imaging_element/lib/python3.7/site-packages/datajoint/table.py in _delete_cascade(self)
    361                     fk_attrs = [k.strip('`') for k in match.group('fk_attrs').split(',')]
    362                     pk_attrs = [k.strip('`') for k in match.group('pk_attrs').split(',')]
--> 363                     child &= self.proj(**dict(zip(fk_attrs, pk_attrs)))
    364                 else:
    365                     child &= self.proj()

~/anaconda3/envs/imaging_element/lib/python3.7/site-packages/datajoint/expression.py in proj(self, *attributes, **named_attributes)
    346         try:
    347             raise DataJointError("Attribute `%s` already exists" % next(
--> 348                 a for a in rename_map if a in attributes.union(compute_map).union(replicate_map)))
    349         except StopIteration:
    350             pass  # all ok

DataJointError: Attribute `subject_fullname` already exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions