add_column and add_item erroneously(?) require new_fingerprint parameter

Open Beginner friendly
#7,864 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
data

Research direction

Start in src/datasets/arrow_dataset.py at the add_column and add_item signatures referenced in the issue, then compare their docstrings with the dataset constructor's optional fingerprint parameter. Confirm the intended public API behavior and update either the signatures or documentation consistently. Done means both methods' behavior and documentation agree, with coverage for the corrected interface.

Written by the indexing model from the issue text.

Description

Describe the bug

Contradicting their documentation (which doesn't mention the parameter at all), both Dataset.add_column and Dataset.add_item require a new_fingerprint string. This parameter is passed directly to the dataset constructor, which has the fingerprint parameter listed as optional; is there any reason it shouldn't be optional in these methods as well?

Steps to reproduce the bug

Reproduction steps:

  1. Look at the function signature for add_column: https://github.com/huggingface/datasets/blob/17f40a318a1f8c7d33c2a4dd17934f81d14a7f57/src/datasets/arrow_dataset.py#L6078
  2. Repeat for add_item: https://github.com/huggingface/datasets/blob/17f40a318a1f8c7d33c2a4dd17934f81d14a7f57/src/datasets/arrow_dataset.py#L6336
Expected behavior

add_column and add_item should either set the fingerprint parameter to optional or include it in their docstrings

Environment info

Not environment-dependent

Dominant language
Python
Stars
22k
Forks
3.4k
Avg merge
4d 4h
Merged PRs (30d)
15

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from huggingface/datasets

All issues in huggingface/datasets

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.