Skip to content

Dataroast Commands not properly accepting arguments #65

@TomJDonahue

Description

@TomJDonahue

There is an issue in the command.py file of the dataroast folder. When calling from_string, the parsed_args variable never gets added to if the args only contains strings. I added the else block, and the function now works appropriately.

Note, the merge command (which the 'if "," in arg:' line is attempting to solve for) still doesn't work properly.

` def from_string(command: str) -> "Command":
parts = command.split()
cmd, raw_args = parts[0], parts[1:]

    # Process each argument, converting to appropriate type
    parsed_args: list[str | int | list[str]] = ['' for arg in raw_args]
    for i, arg in enumerate(raw_args):
        try:
            if "," in arg:
                parsed_args[i] = arg.split(",")
            elif arg.isnumeric():
                parsed_args[i] = int(arg)
            else:
                parsed_args[i] = arg
        except ValueError:
            pass

    if not cmd_exists(cmd):
        raise ValueError(f"Command {cmd} does not exist.")
    return Command(cmd, parsed_args)

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions