-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[25.1] Avoid missing field value failure in data tables #21008
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
base: release_25.1
Are you sure you want to change the base?
[25.1] Avoid missing field value failure in data tables #21008
Conversation
5931704 to
e6d1516
Compare
e6d1516 to
b1946d8
Compare
| if empty_field_value is not None: | ||
| self.empty_field_values[name] = empty_field_value | ||
| assert "value" in self.columns, "Required 'value' column missing from column def" | ||
| if "name" not in self.columns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit says Attempt to not require name column but what you're removing here seems to be the fallback definition for name. Can you start with a test case (automated or not) that breaks what you're fixing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, thanks for looking into it. I am adding a test case right now and will update PR comment with more details.
Shifted by one relative to what ? I see that https://test.galaxyproject.org/api/tool_data/twobit is missing one column relative to the fields the API claims to return, isn't that the correct bug fix ? Here you're altering all data table definitions, I don't think that's wise ?
I would suggest that the IGV viz throws an error there ? |
|
This does not affect all tables, only those missing the name field, specifically The issue is in the API layer, which inserts a pseudo column that does not exist. Alternatively, the API should throw an error and require a name column in addition to a value column, which I don't think is necessary. |
|
parse_column_spec is not restricted to the API layer though so you might be breaking tools. i'll have a look |
Resolves #21183. Exploring options to resolve a failure caused by injecting an empty
namecolumn into the data table. Because only the column name was added without corresponding field data, the column list becomes longer than the field list. As a result, when searching for a column such aspath, the returned index is shifted by one, leading to an out-of-range error when accessing the corresponding field value.twobitdata tables do not include a name field, and since thepathfield is the last column, any attempt to access it for downloading data from IGV results in a failure. In my view, the correct approach is to avoid injecting an emptynamecolumn, since avaluecolumn is already required and guaranteed to exist. Consumers of this API endpoint should instead fall back to thevaluecolumn or whichever column or index they prefer.How to test the changes?
(Select all options that apply)
License