Skip to content
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

datum filter - TypeError: Dataset.filter() got an unexpected keyword argument 'expr' #1691

Open
joshuasv opened this issue Jan 4, 2025 · 0 comments
Assignees

Comments

@joshuasv
Copy link

joshuasv commented Jan 4, 2025

Problem description

Executing the following command on my datumaro formatted dataset yields this unexpected behavior.

$ datum filter -e '/item[image/width < image/height]' --dry-run my-dataset
2025-01-04 10:55:45,130 ERROR: Dataset.filter() got an unexpected keyword argument 'expr'
Traceback (most recent call last):
  File "/home/gpu/miniconda3/envs/datumaro/bin/datum", line 8, in <module>
    sys.exit(main())
  File "/home/gpu/miniconda3/envs/datumaro/lib/python3.10/site-packages/datumaro/cli/__main__.py", line 166, in main
    retcode = args.command(args)
  File "/home/gpu/miniconda3/envs/datumaro/lib/python3.10/site-packages/datumaro/util/scope.py", line 158, in wrapped_func
    ret_val = func(*args, **kwargs)
  File "/home/gpu/miniconda3/envs/datumaro/lib/python3.10/site-packages/datumaro/cli/commands/filter.py", line 184, in filter_command
    dataset = dataset.filter(expr=filter_expr, **filter_args)
TypeError: Dataset.filter() got an unexpected keyword argument 'expr'

Expected behavior

Print XML representations of the filtered dataset and exit

Additional information

$ datum dinfo my-dataset
length: 6772
categories: label
  label:
    count: 1
    labels: label1
subsets: val, train
  'val':
    length: 980
    categories: label
      label:
        count: 1
        labels: label1
  'train':
    length: 5792
    categories: label
      label:
        count: 1
        labels: label1
$ datum detect my-dataset
Detected format: datumaro
$ python --version
Python 3.10.16
$ datum --version
1.9.1
$ conda --version
conda 24.4.
$ pip --version
pip 24.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants