datajoint / datajoint-matlab

Relational data pipelines for the science lab
MIT License
42 stars 38 forks source link

bug with fetchn in DJ 3.4.1 MATLAB #353

Closed arsenyf closed 3 years ago

arsenyf commented 3 years ago

Bug Report

Description

I switched to DJ 3.4.1 and the behavior of "fetchn" had changed. In older versions, if the query was empty "fetchn" used to return just an empty result. But in the new version it throws an error. To solve this I now need to wrap every fetchn with an if statement to check that the query is not empty, which is very cumbersome.

Reproducibility

Include:

Expected Behavior

A clear and concise description of what you expected to happen.

I expect to get an empty result of the fetchn.

Instead I get:

tr_ignore = fetchn(EXP.BehaviorTrial & key & 'outcome="ignore"','trial'); Index exceeds the number of array elements (0).

Error in dj.internal.GeneralRelvar/fetchn (line 292) if isnumeric(s(1).(name{1}{1})) && length(s(1).(name{1}{1})) == 1