Giter VIP home page Giter VIP logo

Comments (2)

keithing avatar keithing commented on September 26, 2024 1

That sort of documentation could be a little difficult to maintain. I can imagine it would be very easy to add new functions and forget to add this extra documentation. In general, I think best practice here would be to log the http requests directly. civis uses httr so we can add a hook to httr to produce logs. For example:

(Quick Side Note: be careful that all the logs produced below will contain your api key)

library(civis)                                                                                                                                                
httr::set_config(httr::verbose())                                               
df <- read_civis(sql("SELECT 1"), database="database") 

Prints all the logs, including:

-> GET /databases/ HTTP/1.1^M 
-> GET /credentials/?default=TRUE
-> POST /scripts/sql HTTP/1.1^M  

So my advice for this would be

  1. to add the httr::set_config(httr::verbose()) hook to the script of calls they need to make
  2. write that output to a log file
  3. search the logs for GET, POST, PUT and PATCH.

Using a linux/mac command line:

Rscript my_script_with_hook.R >log.txt 2>&1
cat log.txt | grep "GET\|POST\|PUT\|PATCH"

remove log.txt when you are done with it since it has your api key stored in it

from civis-r.

patr1ckm avatar patr1ckm commented on September 26, 2024

Interesting! I can see that. What would the ideal method for communicating this be for you? In the web docs of the function? In a specific page for html docs? In redshift?

from civis-r.

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.