Skip to content

Bug in cli filter command #29

@Jegp

Description

@Jegp

Currently, when running the filter command from the command line, the following error appears:

$ faery input file dvs.es filter render --help
Traceback (most recent call last):
  File "/home/jens/work/faery/.venv/bin/faery", line 8, in <module>
    sys.exit(__main__.main())
             ^^^^^^^^^^^^^^^
  File "/home/jens/work/faery/python/faery/__main__.py", line 76, in main
    cli.first_block_keyword_to_command[sys.argv[1]].run(sys.argv[1:])
  File "/home/jens/work/faery/python/faery/cli/process.py", line 643, in run
    stream_wrapper.add_filter(subcommand_arguments)
  File "/home/jens/work/faery/python/faery/cli/process.py", line 522, in add_filter
    parser = filter_parser(self.stream.__class__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jens/work/faery/python/faery/cli/process.py", line 182, in filter_parser
    name_to_filter = list_filters.class_to_name_to_filter()[stream_parent_class]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jens/work/faery/python/faery/cli/list_filters.py", line 467, in class_to_name_to_filter
    raise Exception(
Exception: unsupported parameter type typing.Union[faery.timestamp.Time, str, NoneType] in filter regularize of <class 'faery.events_stream.EventsStream'>

We should

  1. Fix the parameter type error, and
  2. Introduce a unit test that ensures the filter doesn't crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions