Giter Site home page Giter Site logo

infuser's Introduction

STATS

Mostly dad of three. Often founder of Dataroots. Sometimes a trail runner, now and then a cyclist. Trying to survive creative & outdoor splurges. Enjoys fantasy writing & literate programming.

💬 Ask me about: open source, sports & outdoors, data, creative ideas.
📫 How to reach me:
     💌 professional mail
     🧳 LinkedIn
     💿 dataroots
     🥷 mastodon
😄 Pronouns: he/him
🧀 Cheese: YAS.

infuser's People

Contributors

bart6114 avatar mschubert avatar zachmayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infuser's Issues

passing parameter values through a file

great package, but is it possible to pass parameter values in a file rather than in function? this would make it far easier in cases where a large number of values have to be instantiated in the template

control flow?

Awesome package. Does this package currently support control flow?

Something like

SELECT *
FROM FAKE_TABLE
WHERE ds = '2016-08-01'
{% if capped %}
AND dim_is_capped
{% else %}
AND NOT dim_is_capped
{% endif %}

where capped controls what goes to the WHERE clause.

issues when using specific variable_identifier

Thanks for this great package.

I have an issue when using the parameter "variable_identifier" with the 'infuse' function. It does not seem to be taken into account.
However, function 'variables_requested' works as expected with specific parameter 'variable_identifier'. It seems that function 'infuse' does not pass along the parameter 'variable_identifier' to sub call to function 'variable_requested'.

Example:
my_sql<-"SELECT * FROM Customers WHERE Year = ${year} AND Month = ${month};"
variables_requested(my_sql, variable_identifier = c("${","}"), verbose = TRUE)
infuse(my_sql, year=2015, month=2, variable_identifier = c("${","}"), verbose=TRUE)

I hope it make sense.
best,

Vincent.

Suggestion for parameters

Hello
Very nice package. Does the job. One suggestion, in the call to infuse which is

infuse<-function (file_or_string, ..., variable_identifier = c("{{", 
"}}"), default_char = "|", verbose = FALSE) 

Could the function take an argument, say args_as_list which if non null (or not missing) becomes params_supplied ? So, code like

 params_supplied  = if(missing(args_as_list)) list(...) else args_as_list

Sometimes i build my substitution in a list and rather not have to use do.call.
Cheers

misplaced brackets in `read_template`

In this function read_template the following line (line 16, in helpers.R)

} else if(is.character(file_or_string) && nchar(file_or_string > 0)){

should it not be nchar(file_or_string) > 0 instead of nchar(file_or_string > 0) , I have a huge string which was returning NA for the logical operation. I am yet to figure out which specific part of the string is causing this behaviour. Will post that as a test case, once I figure it out.

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.