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

NIAD-2851: Remove unexplained call to handleObservationStatement #722

Conversation

adrianclay
Copy link
Collaborator

@adrianclay adrianclay commented Jul 22, 2024

Why

A BATTERY CompoundStatement can only have two types of component inside it according to the GP2GP specification. These are:

  • A CLUSTER CompoundStatement
  • An ObservationStatement

The existing code within handleBatteryCompoundStatement deals with each of those cases already. The additional code removed in this change appears to deal with any type of CompoundStatement. Given that the only CompoundStatement which is valid to appear here is a CLUSTER, and the code for handleClusterCompoundStatement already calls handleObservationStatement, there is no point to this code.

By removing this duplicate call to handleObservationStatement we also fix the issue where Observations are being generated with two identical "category" values of "Laboratory".

Furthermore, this code is completely untested. It is a liability in its current state, so the removal of it reduces the chance of it breaking and introducing more unwelcome unintended side-effects.

Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the Changelog with details of my change in the UNRELEASED section if this change will affect end users
  • A corresponding change has been made to the Mapping Documentation repository

@adrianclay adrianclay force-pushed the NIAD-2851-remove-duplicate-iteration-over-observation-statements branch 3 times, most recently from 68e90f5 to ece7b75 Compare July 25, 2024 13:25
@adrianclay adrianclay changed the title Remove strange duplicated call to handleObservationStatement NIAD-2851: Remove unexplained call to handleObservationStatement Jul 25, 2024
@adrianclay adrianclay force-pushed the NIAD-2851-remove-duplicate-iteration-over-observation-statements branch from ece7b75 to 95135d6 Compare July 25, 2024 13:29
A BATTERY CompoundStatement can only have two types of component
inside it according to the GP2GP specification. These are:

- A CLUSTER CompoundStatement
- An ObservationStatement

The existing code within handleBatteryCompoundStatement deals with
each of those cases already. The additional code removed in this
change appears to deal with any type of CompoundStatement. Given
that the only CompoundStatement which is valid to appear here is
a CLUSTER, and the code for handleClusterCompoundStatement already
calls handleObservationStatement, there is no point to this code.

By removing this duplicate call to handleObservationStatement we
also fix the issue where Observations are being generated with
two identical "category" values of "Laboratory".

Furthermore, this code is completely untested. It is a liability in
its current state, so the removal of it reduces the chance of it
breaking and introducing more unwelcome unintended side-effects.
@adrianclay adrianclay force-pushed the NIAD-2851-remove-duplicate-iteration-over-observation-statements branch from 95135d6 to 74b1352 Compare July 25, 2024 13:31
@adrianclay adrianclay marked this pull request as ready for review July 25, 2024 13:33
@adrianclay adrianclay enabled auto-merge (squash) July 25, 2024 13:33
@adrianclay adrianclay merged commit 60675ff into main Jul 25, 2024
1 check passed
@adrianclay adrianclay deleted the NIAD-2851-remove-duplicate-iteration-over-observation-statements branch July 25, 2024 14:09
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.

2 participants