Git Product home page Git Product logo

Comments (4)

cpcloud avatar cpcloud commented on August 29, 2024 1

This seems like a footgun, since any mistakes in filter specification that result in empty arguments (like an incorrect list comprehension) will silently pass through and appear to have no effect.

We'd also want to make this behavior consistent throughout our APIs if we did do it.

For example order_by must be called with at least one key, do we now want to allow that to do nothing if no keys are passed. What about mutate, should that also be no-op with nothing passed? select? What about drop_null/fill_null, rename, relocate? All of these need thinking through for such a change.

It's not as convenient for your particular case, but as the application/library developer you're the only person that knows whether an empty filter is reasonable thing to pass into Ibis from your API.

from ibis.

gforsyth avatar gforsyth commented on August 29, 2024 1

I'm going to close this out as unplanned.
That said, @NickCrews your anywidget thing looks awesome!

from ibis.

gforsyth avatar gforsyth commented on August 29, 2024 1

I didn't do the "if not filters" and then I accidentally passed in no filters and I got an error.

Not necessarily fun, but much better to get a loud error than a silent one.

from ibis.

NickCrews avatar NickCrews commented on August 29, 2024

Hmmm good point, we would need to change all the other APIs too. I could be convinced that all those changes are good too. I think they're solvable, but this is definitely not a huge pain so let's leave for now.

To play devils advocate for a moment though: I footgunned myself with the inverse: In my application code, at first I didn't do the "if not filters" and then I accidentally passed in no filters and I got an error. So both choices lead to footguns, just ones of different characteristics. I think I agree your example footgun is more likely than mine though.

from ibis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.