Copilot commented on code in PR #166: URL: https://github.com/apache/otava/pull/166#discussion_r3839416399
########## otava/csv_options.py: ########## @@ -17,6 +17,39 @@ import enum from dataclasses import dataclass +from typing import Optional + +import configargparse + + +@dataclass +class CsvConfig: + NAME = "csv" + + delimiter: Optional[str] = None + quote_char: Optional[str] = None + + @staticmethod + def add_parser_args(arg_group): + arg_group.add_argument( + "--csv-delimiter", Review Comment: `csv.reader` requires a one-character delimiter, but this CLI/env/config option accepts arbitrary strings. For example, `--csv-delimiter '::'` parses successfully and later crashes during import with `TypeError: "delimiter" must be a 1-character string`. Add a ConfigArgParse type validator so invalid values are rejected when configuration is parsed. This issue also appears on line 41 of the same file. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
