-
Notifications
You must be signed in to change notification settings - Fork 100
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
Output fieldName of missing_recommended_field notice even if there is no column #1425
Comments
I checked the variables using the debugger and my guess was correct. If a recommended column is not in the header, columnIndex will be -1 and getColumnName() will not return the column name, so the feedName will not be output. |
Thank you for opening this issue @takohei! |
@isabelle-dr As a test, I changed the argument of axX()@RowParser.java from FieldLevelEnum to GtfsColumnDescriptor and it worked well.
|
Hello @takohei, you are right. Using the GtfsColumnDescriptor is the way to go. I fix this issue by using this approach. Thanks for digging deep into the code. |
…if there is no column (#1511) * replace FieldLevelEnum with GtfsColumnDescriptor * use columnDescriptor instead of columnDescriptor.fieldLevel() in TableDescriptorGenerator * fix broken tests * fixe asString_recommended_missing test format code * format code * remove the old asString method --------- Close #1425 Co-authored-by: David Gamez <1192523+davidgamez@users.noreply.github.com>
Describe the bug
It is specified in RULES.md that the notice of missing_recommended_field should have fieldNames.
However, if there is no column in the header, the fieldName is not output.
So it is difficult for us to identify which field is unset.
Steps/Code to Reproduce
Validate attached feed.
It has no column for feed_contact_email and no value for feed_contact_url in the feed_info.txt.
Expected Results
In report.json, both feed_contact_email and feed_contact_url notices have fieldNames.
Actual Results
In report.json, the feed_contact_url notice has fieldName, but the feed_contact_email notice has no fieldName.
Screenshots
The detail table of report.json has value but no header of fieldName.
Files used
no_mail_column_no_url_value_akocity.zip
report.json.txt
Validator version
4.1.0
Operating system
Windows
Java version
18
Additional notes
This is just a guess as I do not have a development environment, but the following code may not get the column name if there is no column header.
gtfs-validator/core/src/main/java/org/mobilitydata/gtfsvalidator/parsing/RowParser.java
Lines 134 to 138 in 19ed06d
The text was updated successfully, but these errors were encountered: