-
Notifications
You must be signed in to change notification settings - Fork 12
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
In text tables, validate attempts to match pattern associated with data_type
before checking Special_Constants
#837
Comments
data_type
before checking Special_Constant
sdata_type
before checking Special_Constants
This is a chicken and egg problem. The value in the table is being converted to compare to the special constants. In most cases that we have, floats convert to out of range floats or ints or longs or doubles. In this case, the conversion to a time is trouble before it can be compared to the special constant. Error is here: validate/src/main/java/gov/nasa/pds/tools/validate/content/table/FieldValueValidator.java Line 355 in a232ceb
and is duplicated here: validate/src/main/java/gov/nasa/pds/tools/validate/content/table/FieldValueValidator.java Line 392 in a232ceb
but check for special constants is done further down and only for min/max. The best suggestion is during the handling of the exception check to see if the string content matches any of the special characters and if it does, do not generate the error. I am sure this will lead to some cases where the match should generate an error but others not. If the proposed solution sounds reasonable I will make the fix. |
Yeah, it makes sense to me to do special constant checking in text fields as a string comparison operation (rather than value-based after conversion/interpretation). |
I made the changes but still not to sure we want to do this. The model says that special constants should be in the format of the data. If it cannot be converted, then it is not in the format. Not in the format, then breaks the model. If you agree @jordanpadams then delete the PR and branch. Otherwise it is there and done. |
@al-niessner that is a good question. I will bring this to some other folks for thought. |
@jordanpadams @al-niessner @cgobat Not sure what to do about this. If validate matches the special constants by string, the value of the special constant can be anything with any type. In the attached example, the .xml has
and validate passes the .csv, which has
Do we accept that? The PDS3 standard wanted strings "N/A", "UNK", and something else in numerical ASCII fields. I think that hurt processing software (besides validate), maybe because such software couldn't directly read data into numerical variables. But the only way I see for marking a fake time value is to exceed the type limitations of ASCII_Time. |
@rchenatjpl good point. We probably need to take this to the DDWG for clarification. |
It seems to me that the value being rejected (specifically |
@matthewtiscareno actually, what I believe @rchenatjpl is saying is that both of those constants ( @rchenatjpl not sure what the best answer is here. currently these |
Wait, what? I thought the whole point of special constants was that they have the same data type as the rest of the column but encode a specific meaning. Is this what is usually done but not actually required by Validate? Is that intentional? What do the standards say? |
Checked for duplicates
Yes - I've already checked
May be part of #832 and/or related to #831, but I figured I'd open this for another example case if nothing else.
🐛 Describe the bug
When validating an ASCII table of times that uses "99:99:99" as a
Special_Constants/not_applicable_constant
value, validate fails due to the presence of the 99:99:99 value(s), with the message🕵️ Expected behavior
I expected that instances of
Special_Constants
would get special treatment, and would be allowed as exceptions todata_type
format rules.📜 To Reproduce
<data_type>
<Special_Constants>
in the label🖥 Environment Info
🩺 Test Data / Additional context
Sample data:
Relevant label section:
The sample data file, a functionally complete label for it, and a failing validate report can be found in this attached gzipped tar file.
🦄 Related requirements
No response
⚙️ Engineering Details
Hopefully fairly simple fix to change ordering of checks here.
The text was updated successfully, but these errors were encountered: