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

Fix renaming a dimension in aggregations #1333

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

tdrwenski
Copy link
Member

@tdrwenski tdrwenski commented Apr 15, 2024

Description of Changes

Renaming an aggregation dimension using NcML does not work-- it will throw an exception in the case of an aggregation with a scan element (see Unidata/tds#490) and have the wrong size in the case of an aggregation with locations. The aggregation dimension is already part of the groupBuilder, so we need to use that instead of the refGroup (which is the dimension from a single file, or null in the case of a scan), in order to treat it as an existing dimension instead of a new one.

@tdrwenski tdrwenski changed the title Fix renaming a dimension in an aggregation scan Fix renaming a dimension in an aggregations Apr 15, 2024
@tdrwenski tdrwenski marked this pull request as ready for review April 15, 2024 13:35
@@ -810,9 +810,11 @@ private void readDim(Group.Builder groupBuilder, @Nullable Group refGroup, Eleme

String nameInFile = dimElem.getAttributeValue("orgName") != null ? dimElem.getAttributeValue("orgName") : name;

// LOOK this is wrong, groupBuilder may already have the dimension.
Copy link
Member

Choose a reason for hiding this comment

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

🤣

@haileyajohnson haileyajohnson merged commit 3c409dc into Unidata:maint-5.x Apr 15, 2024
10 checks passed
@tdrwenski tdrwenski deleted the rename-dim-agg branch April 15, 2024 15:10
@tdrwenski tdrwenski changed the title Fix renaming a dimension in an aggregations Fix renaming a dimension in aggregations Apr 16, 2024
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.

None yet

2 participants