Skip to content

Job not found - Possible API changes (request string) #78

@lynuhs

Description

@lynuhs

When running any function that requires getting a job I get an error thrown that says:

Request Status Code: 404
Error: API returned: Not found: Job qvalento-[REDACTED]:job_b6q6[REDACTED]

I noticed the same thing in Google Apps Script and it seems that it's because the job location is in a sub-region and it requires a bit of modification in the request.

When I apply another argument in pars_args in the gar_api_generator within bqr_query with location information I get it to work again.

pr <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
                                     "GET",
                                     path_args = list(projects = projectId,
                                                      queries = jobId),
                                     pars_args = list(pageToken = pageToken, 
                                                      location = attr(data, "jobReference")$location), # The added row
                                     data_parse_function = parse_bqr_query)

Do you think that is a correct solution, and if so, could you update all functions to use that logic?

BR Linus

Session Info

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_Sweden.1252 LC_CTYPE=English_Sweden.1252 LC_MONETARY=English_Sweden.1252
[4] LC_NUMERIC=C LC_TIME=English_Sweden.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] bigQueryR_0.5.0 stringr_1.4.0 xlsx_0.6.5 googleAuthR_1.4.1 plyr_1.8.6 dplyr_1.0.7
[7] httr_1.4.2

loaded via a namespace (and not attached):
[1] zip_2.2.0 Rcpp_1.0.7 LynuhsR_0.0.0.9000 pillar_1.6.4
[5] compiler_4.1.2 tools_4.1.2 digest_0.6.29 jsonlite_1.7.2
[9] memoise_2.0.1 lifecycle_1.0.1 gargle_1.2.0 tibble_3.1.6
[13] pkgconfig_2.0.3 rlang_0.4.12 cli_3.1.0 rstudioapi_0.13
[17] yaml_2.2.1 curl_4.3.2 fastmap_1.1.0 rJava_1.0-6
[21] googleCloudStorageR_0.7.0 withr_2.4.3 askpass_1.1 generics_0.1.1
[25] fs_1.5.2 vctrs_0.3.8 xlsxjars_0.6.1 rappdirs_0.3.3
[29] tidyselect_1.1.1 glue_1.6.0 R6_2.5.1 fansi_0.5.0
[33] purrr_0.3.4 magrittr_2.0.1 ellipsis_0.3.2 assertthat_0.2.1
[37] utf8_1.2.2 stringi_1.7.6 openssl_1.4.6 cachem_1.0.6
[41] crayon_1.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions