You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
The behaviour of the program is deviated from what is described in the documentation.
I can reproduce this problem for more than one time.
This is NOT a 3-digit error -- it does not display an error message like something went wrong. Status code: 400.
This is a 3-digit error and I have consulted the Understanding API errors vignette and the suggestions do not help.
Describe the bug
Although it is quite clear that build_query (and functions depending on it, e.g. get_all_tweets) accepts character and character vector, it is not enforced by the program. One symptom of it is that build_query can actually accept a 1-d data frame and weirdness like #230 arises. Also, it generates some queries that surely will give a 400 error.
Expected Behavior
Two solutions: coerce anything to vector or simply raise an error when the input of build_query is not character or character vector. My preferred solution is the latter.
Steps To Reproduce
require(academictwitteR)
#> Loading required package: academictwitteRx<-data.frame(username= c("a", "b", "c"))
build_query(query=x)
#> username#> 1 a#> 2 b#> 3 c
build_query(users=x)
#> [1] " (from:c(\"a\", \"b\", \"c\"))"
build_query(reply_to=x)
#> [1] " (to:c(\"a\", \"b\", \"c\"))"
build_query(retweets_of=x)
#> [1] " (retweets_of:c(\"a\", \"b\", \"c\"))"
get_all_tweets(users=x, start_tweets="2021-01-01Z00:00:00", end_tweets="2021-02-01Z00:00:00")
#> Warning: Recommended to specify a data path in order to mitigate data loss when#> ingesting large amounts of data.#> Warning: Tweets will not be stored as JSONs or as a .rds file and will only be#> available in local memory if assigned to an object.#> query: (from:c("a", "b", "c"))#> Error in make_query(url = endpoint_url, params = params, bearer_token = bearer_token, : something went wrong. Status code: 400
Thanks for raising this. I think the best option here is to raise an error when input is not character vector, as you say. This has the added benefit of enforcing proper usage (e.g., not passing a data.frame object to build_query())
Please confirm the following
something went wrong. Status code: 400.
Describe the bug
Although it is quite clear that
build_query
(and functions depending on it, e.g.get_all_tweets
) accepts character and character vector, it is not enforced by the program. One symptom of it is thatbuild_query
can actually accept a 1-d data frame and weirdness like #230 arises. Also, it generates some queries that surely will give a 400 error.Expected Behavior
Two solutions: coerce anything to vector or simply raise an error when the input of
build_query
is not character or character vector. My preferred solution is the latter.Steps To Reproduce
Created on 2021-08-24 by the reprex package (v2.0.0)
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: