Handle WP NEM12 edge-case with missing MSATSLoadDateTime col #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Western Power NEM12 files don't always include an empty column for MSATSLoadDateTime if it is never present, instead the column can be completely absent.
This occurs with files downloaded from their internal portal and causes a ValueError exception to be unnecessarily raised on parse, as the number of columns is less than expected.
The AEMO Meter Data File Format Specification NEM12 & NEM13 states that MSATSLoadDateTime is required if available, but is not mandatory.
As such, instead of erroring when the final MSATSLoadDateTime column isn't present, we can proceed and fill it with None with no consequences.
Validation for parse_300_row has been modified to ensure that the error is only raised if number of required non-reading fields is less than 6, instead of equals 7.
These WP NEM12 files otherwise seem to parse fine with this change.