You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line and column numbering feature introduced in #6285 has a reliability problem, which can cause incorrect error messages to appear in certain cases.
Reproduce
Initialize DVC.
dvc init --no-scm
Create dvc.yaml
tee -a dvc.yaml <<ENDstages: train: cmd: - python train.py deps: - config.cfg outs: models/END
List the contents of the repository
$ dvc ls .'./dvc.yaml' validation failed.
expected a list, in stages -> train -> outs, line 3, column 5
2 train:
3 │ cmd:
4 │ - python train.py
As you can see, DVC reports the error as occurring on line 3, column 5. However, the actual error is located on line 7, column 5. The reported line number is off by four lines, making it difficult to pinpoint the source of the error.
Expected
When validating a YAML file, DVC should provide accurate line and column numbers for any errors that occur. This ensures that users can quickly identify and fix problems in their YAML files.
We understand that certain data types may lack a `lc` property, so we utilize the `key()` and `item()` methods of the `lc` property to obtain the line and column details for such types. Even though we still need to navigate to the parent mapping or sequence to access the `lc` property, these methods enable us to handle diverse data types seamlessly and display accurate line and column information.
Fixesiterative#10109
Signed-off-by: hqdncw <[email protected]>
Bug Report
Description
The line and column numbering feature introduced in #6285 has a reliability problem, which can cause incorrect error messages to appear in certain cases.
Reproduce
dvc.yaml
As you can see, DVC reports the error as occurring on line 3, column 5. However, the actual error is located on line 7, column 5. The reported line number is off by four lines, making it difficult to pinpoint the source of the error.
Expected
When validating a YAML file, DVC should provide accurate line and column numbers for any errors that occur. This ensures that users can quickly identify and fix problems in their YAML files.
Environment information
Output of
dvc doctor
:Additional Information (if any):
Related to #10102
The text was updated successfully, but these errors were encountered: