Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading output when using query with location and nrows #36

Open
pvanheus opened this issue Nov 8, 2022 · 3 comments
Open

Misleading output when using query with location and nrows #36

pvanheus opened this issue Nov 8, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@pvanheus
Copy link

pvanheus commented Nov 8, 2022

With the following query:

african_entries  <- query(credentials,
  location = "Africa / ...",
  nrows = 1000
)
nrow(african_entries)

I get the following output:

Loading entries in batches...
Returning 0-50 of 140609 entries.
Returning 50-100 of 140609 entries.
Returning 100-150 of 140609 entries.
Returning 150-200 of 140609 entries.
Returning 200-250 of 140609 entries.
Returning 250-300 of 140609 entries.
Returning 300-350 of 140609 entries.
Returning 350-400 of 140609 entries.
Returning 400-450 of 140609 entries.
Returning 450-500 of 140609 entries.
Returning 500-550 of 140609 entries.
Returning 550-600 of 140609 entries.
Returning 600-650 of 140609 entries.
Returning 650-700 of 140609 entries.
Returning 700-750 of 140609 entries.
Returning 750-800 of 140609 entries.
Returning 800-850 of 140609 entries.
Returning 850-900 of 140609 entries.
Returning 900-950 of 140609 entries.
Returning 950-1000 of 140609 entries.
> nrow(african_entries)
[1] 1000

I.e. it is doing the right thing but printing misleading output.

P.S. how can I check which commit my current GISAIDR install is from, in order to provide a "version number"?

@Wytamma
Copy link
Owner

Wytamma commented Nov 8, 2022

Hey @pvanheus, internally GISAIDR runs a loop to batch queries with > 50 rows requested. Loading entries in batches... means it doing this batching. The Returning X-Y of 140609 entries. message is printed because GISAIDR is calling query internally and that message is printed with each call. Should I change the message in someway?

I'm not sure how to check the commit unless you installed from a specific commit with a command like:

remotes::install_github("Wytamma/GISAIDR@commitSHA")

I'm pretty careful with the version number so you could try to match that up with the commit it changed (e.g. search the commits for your version number). I haven't been using release tags because any old version of GISAIDR is essentially out of date i.e. if GISAID changes it breaks all previous versions.

Hope that helps in someway!

@pvanheus
Copy link
Author

pvanheus commented Nov 14, 2022

Hi there... so that message should be read as "Returning entries at positions X-Y in the list of Z total entries"? I got confused because I thought "hey, I've asked for 1000 entries, why is it telling me about the whole collection". I think the issue is that there's 2 levels involves: entries X-Y out of the ones you asked for, and then the total number of entries out there. I can't really think of better wording though.

@Wytamma
Copy link
Owner

Wytamma commented Nov 16, 2022

Ah I get your point! Will see what I can do to make it a bit clearer... I will have to refractor things at some point 😅

@Wytamma Wytamma added the enhancement New feature or request label Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants