Skip to content

Conversation

@DeclanBuchanan
Copy link

PR Description

Please describe the changes proposed in the pull request:

  • the function add_column willl now automatically fill remaining, without the user needing to use the fill-remaining parameter

This PR resolves #(put issue number here, and remove parentheses).

PR Checklist

Please ensure that you have done the following:

  1. [✓ ] PR in from a fork off your branch. Do not PR from <your_username>:dev, but rather from <your_username>:<feature-branch_name>.
  1. [✓ ] If you're not on the contributors list, add yourself to AUTHORS.md.
  1. [✓ ] Add a line to CHANGELOG.md under the latest version header (i.e. the one that is "on deck") describing the contribution.
    • Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Automatic checks

There will be automatic checks run on the PR. These include:

  • Building a preview of the docs on Netlify
  • Automatically linting the code
  • Making sure the code is documented
  • Making sure that all tests are passed
  • Making sure that code coverage doesn't go down.

Relevant Reviewers

Please tag maintainers to review.

My attempt to have the add_column function automatically fill remaining by iterating data argument without the user having to use the fill_remaining parameter.
Copy link
Member

@ericmjl ericmjl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Feedback

Thanks for the PR! I understand the goal is to make fill_remaining automatic.

The essence of "automatic fill remaining" is a behavior change: currently, when fill_remaining=False (the default) and the value length doesn't match the dataframe length, it raises an error. Making it "automatic" means this error would no longer occur - values would be filled/repeated instead.

This is a breaking change that would require a minor version bump (e.g., 0.x → 0.y) -- that's the versioning convention we stick to pre-1.0.

Suggested Approach

If we're going to make this behavior change, the simplest and cleanest implementation is to:

  1. Change the default parameter from False to True:

    fill_remaining: bool = True,  # Changed from False
  2. Revert all the other logic changes - the existing code already handles fill_remaining=True correctly.

  3. Remove the unnecessary additions:

    • The warning on lines 99-100
    • The broken else branch (lines 125-126)
    • The logic modifications that break scalar handling

This approach:

  • Achieves the goal with minimal code changes
  • Keeps all existing logic intact (no risk of new bugs)
  • Maintains backward compatibility (users can still pass fill_remaining=False)
  • Requires a version bump (which is necessary for any behavior change anyway)

The current implementation tries to achieve the same goal but introduces bugs and unnecessary complexity. If we're making a breaking change, let's do it the simple way.

@samukweku
Copy link
Collaborator

@ericmjl should we be updating this function? It is slated for depreciation, and we advise users to use another function instrad

@ericmjl
Copy link
Member

ericmjl commented Dec 6, 2025

@samukweku I think we have enough syntactic sugar here that this can be kept around, actually. Now that I'm thinking of it, I'm can't exactly remember why we decided to deprecate it to begin with. Do you remember, @samukweku?

@samukweku
Copy link
Collaborator

@ericmjl I believe it is covered mostly by the assign method

@samukweku
Copy link
Collaborator

Of course nothing is set in stone

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

Successfully merging this pull request may close these issues.

3 participants