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

feat: add missing_ok: bool = False kwarg to Table.drop() signature #10709

Open
1 task done
NickCrews opened this issue Jan 23, 2025 · 2 comments · May be fixed by #10816
Open
1 task done

feat: add missing_ok: bool = False kwarg to Table.drop() signature #10709

NickCrews opened this issue Jan 23, 2025 · 2 comments · May be fixed by #10816
Labels
feature Features or general enhancements

Comments

@NickCrews
Copy link
Contributor

NickCrews commented Jan 23, 2025

Is your feature request related to a problem?

I have several places where I do:

if "must_not_be_present" in table.columns:
    table.drop("must_not_be_present")
# ...continue on

I want to be able to do non-conditionally: t.drop("must_not_be_present", missing_ok=True)

This is similar to Path.mkdir(exist_ok=True) and Path.unlink(missing_ok=False). These were the inspiration for the name of the param, but I am open to suggestions on different kwarg names. I ran this through chatGPT and other options that were decent were ignore_missing, skip_missing, allow_missing.

What is the motivation behind your request?

No response

Describe the solution you'd like

Adding it as a kwarg argument. This should't be breaking to anyone.

What version of ibis are you running?

main

What backend(s) are you using, if any?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NickCrews NickCrews added the feature Features or general enhancements label Jan 23, 2025
@NickCrews NickCrews changed the title feat: change Table.drop() signature to Table.drop(*fields: str | Selector, ignore_missing: bool = False) feat: add ignore_missing: bool = False kwarg to Table.drop() signature Jan 23, 2025
@NickCrews NickCrews changed the title feat: add ignore_missing: bool = False kwarg to Table.drop() signature feat: add missing_ok: bool = False kwarg to Table.drop() signature Jan 25, 2025
@cpcloud
Copy link
Member

cpcloud commented Feb 10, 2025

missing_ok seems fine!

@NickCrews
Copy link
Contributor Author

BTW, congrats and thank you for your work on getting 10.0 out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Status: backlog
Development

Successfully merging a pull request may close this issue.

2 participants