Giter Club home page Giter Club logo

Comments (5)

sboysel avatar sboysel commented on May 30, 2024 1

I see. I'll go with option A in this PR.

from fredr.

sboysel avatar sboysel commented on May 30, 2024

@DavisVaughan: Just as a heads up, I'm currently working on these functions in a local feature branch.

from fredr.

DavisVaughan avatar DavisVaughan commented on May 30, 2024

Sounds good. I see for the required Params you changed the default from nothing to null. I see the reason you did that (so you can pass to the validation function) but I'd like to ensure the user knows it's required ahead of time. We could either

A) add "required" by the parameter in the documentation

B) restructure the argument checking to be

if(is.missing(search_id)) stop(required_msg, call.=FALSE)
validate_required_param(search_id)

from fredr.

sboysel avatar sboysel commented on May 30, 2024

The function validate_series_id() will throw the error if the user leaves series_id = NULL.

> fredr_series()
 Error: Argument `series_id` must be supplied. 

I don't think there are any endpoints where series_id is an optional parameter.

from fredr.

DavisVaughan avatar DavisVaughan commented on May 30, 2024

I guess im saying, if i was a user and was trying to use this pkg for the first time, how do I know what params are required in the function call the first time I use it? having all of the optional params as param = NULL and the required params as param is a clear way to do that. Or just add it in the docs as "required param" and leave param = NULL for the required params.

Just trying to be uber user friendly and not have the only way they can figure out what is or is not required be running into an error (even if its a helpful one!)

from fredr.

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.