Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insertion error in fresh database #872

Open
samuelbray32 opened this issue Mar 14, 2024 · 2 comments
Open

Insertion error in fresh database #872

samuelbray32 opened this issue Mar 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working merge To do with merge tables position

Comments

@samuelbray32
Copy link
Collaborator

  • When populating LinearizedPositionV1 for the first time in a database, I got an error that cannot call make within a transaction.
  • I think what happened is that the "position_linearization_merge" schema had not yet been made, and it tried to do so at this point

LinearizedPositionOutput._merge_insert(

  • This left the database in a state whereLinearizedPositionV1 was populated for the entry, but the corresponding part table in PositionOutput was not.

Solution
@CBroz1 Is there a preferred way to ensure that the LinearizedPositionOutput table is constructed before this step?

@samuelbray32 samuelbray32 added bug Something isn't working position merge To do with merge tables labels Mar 14, 2024
@CBroz1
Copy link
Member

CBroz1 commented Mar 14, 2024

I think this is a symptom of the norm we've established whereby populates insert into downstream tables, which I would advise against.

In the long term, I'd like to see us move to a norm of running MergeTable.merge_populate('UpstreamTable', mykey) to conduct this set of populate/merge_insert actions.

In the short term, this populate could check the _is_declared property before running calculations and error out if not, asking the user to import the downstream table

@samuelbray32 samuelbray32 self-assigned this Mar 14, 2024
@samuelbray32
Copy link
Collaborator Author

@CBroz1
I might be missing something, but it looks like datajoint changed that property to is_declared

But to access the property, you have to make an instance of the table, which would declare it in the database. This:

  1. means the property is always true
  2. Would raise the error above in the process anyways.

Am I understanding this wrong, or should it be a staticmethod or classmethod in datajoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working merge To do with merge tables position
Projects
None yet
Development

No branches or pull requests

2 participants