Skip to content

Issue 53431: Data Class and Sample Type data doesn't round-trip via folder export/import for field names with special char #6840

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 7 commits into
base: release25.7-SNAPSHOT
Choose a base branch
from

Conversation

cnathe
Copy link
Contributor

@cnathe cnathe commented Jul 11, 2025

cnathe added 2 commits July 11, 2025 16:18
…older export/import for field names with special char

- use ColumnHeaderType.ImportField instead of FieldKey for writing folder archive tsv data column headers
@@ -3768,7 +3768,7 @@ public List<PlateFileBytes> exportPlateData(Container c, User user, ContainerFil
try (TSVGridWriter writer = new TSVGridWriter(plateQueryView::getResults, displayColumns, Collections.singletonMap(sampleIdNameFieldKey.toString(), "Sample ID")))
{
writer.setDelimiterCharacter(delim);
writer.setColumnHeaderType(ColumnHeaderType.FieldKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

My main question is about the usage of these different ColumnHeaderType. Reading through the comments that surround them I'm still not sure which one to choose in which situation.

It looks like up to this point all the usages of ImportField align with usage in import templates, however, there are other usages of ColumnHeaderType.FieldKey that would seem to align with what you're using them for here.

Is ImportField just the new and improved FieldKey that we should be using more widely (I assume not)? I may be off-base here as you may have already discussed with @labkey-susanh who looks to familiarity with this enumeration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree. This enum is confusing. The comment for FieldKey, which has been there since 2015 saying "Useful for import/export round-tripping" is wrong. We do not support FieldKey on import (see my attempt to add it here #6270). Maybe it is time to remove that part of the comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

ImportField was added specifically because, as Cory said, round-tripping with FieldKey doesn't work currently. Given this, I'm not sure when FieldKey is useful as a column header type. Perhaps it worked at some point, but I doubt it. Since this targets 25.7, we shouldn't remove it altogether here, I think, but might consider that for develop.

…/export round-tripping" since that isn't the case
@@ -3768,7 +3768,7 @@ public List<PlateFileBytes> exportPlateData(Container c, User user, ContainerFil
try (TSVGridWriter writer = new TSVGridWriter(plateQueryView::getResults, displayColumns, Collections.singletonMap(sampleIdNameFieldKey.toString(), "Sample ID")))
{
writer.setDelimiterCharacter(delim);
writer.setColumnHeaderType(ColumnHeaderType.FieldKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

ImportField was added specifically because, as Cory said, round-tripping with FieldKey doesn't work currently. Given this, I'm not sure when FieldKey is useful as a column header type. Perhaps it worked at some point, but I doubt it. Since this targets 25.7, we shouldn't remove it altogether here, I think, but might consider that for develop.

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

Successfully merging this pull request may close these issues.

3 participants