Skip to content

ExpObjectDataIterator: consolidate iterator logic #6788

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

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

labkey-nicka
Copy link
Contributor

@labkey-nicka labkey-nicka commented Jun 24, 2025

Rationale

This is the remanent refactor of prior work done to address Issue 53153.

Related Pull Requests

Changes

  • Introduce ExpDataTypeDataIterator to encapsulate logic for data iterators that operate on experiment materials and data.
  • Fix FlagDataIterator logic to not rely on presence of lsid column

try
{
if (_isSample)
ExpObject expObject = null;
if (_context.getInsertOption().mergeRows && _nameCol != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't your doing, but it's not clear why this logic about the name column is inside the if for the lsid being a string. The lsid comes into play only if the object isn't found by name.

Copy link
Contributor Author

@labkey-nicka labkey-nicka Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes. I agree, this logic was pretty snarled. I've refactored this to not be nested in the lsid check. See 7cb5ff1.

@labkey-nicka labkey-nicka changed the title Issue 53153: Accept rowId value for "AliquotedFrom" ExpObjectDataIterator: consolidate iterator logic Jul 3, 2025
}
}
}
else if (_lsidCol != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's kind of silly, but you could have both the name and the LSID columns, so perhaps this logic should be more like in the FlagDataIterator where we go into the lsid block of obj is null?

{
for (Map.Entry<String, Object> entry : _lsidAliasMap.entrySet())
if (_context.getInsertOption().mergeRows && _nameCol != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the check for mergeRows here is correct. Couldn't you also have a _nameCol for the update case?


Object flagValue = get(_flagCol);
ExpObject expObject = null;
if (_nameCol != null && _context.getInsertOption().mergeRows)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here about merge vs. update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants