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

Improve typing on table creation #150

Open
yaitskov opened this issue Aug 12, 2020 · 0 comments
Open

Improve typing on table creation #150

yaitskov opened this issue Aug 12, 2020 · 0 comments

Comments

@yaitskov
Copy link

I want to create a simple table and get a runtime error. BigQuery service is not bothered with explaining what actually is missing and Haskell type system pass incomplete query.

:set -XOverloadedStrings
:set -XGADTs
:set -XTypeFamilies
import Control.Lens ((&), (.~), (<&>), view, set)
import Network.Google
import Network.Google.BigQuery
bqe cmd = runResourceT (runGoogle e (send cmd))
bqe $ tablesInsert (table & (tabFriendlyName .~ (Just "tbl2")) & (tabId .~ (Just "tbl2")) & (tabSchema .~ (Just (tableSchema & tsFields .~ [tableFieldSchema & tfsName .~ (Just "name") & tfsType .~ (Just "STRING")])))) "ds2" prjId

*** Exception: ServiceError (ServiceError' {_serviceId = ServiceId "bigquery:v2", _serviceStatus = Status {statusCode = 400, statusMessage = "Bad Request"}, _serviceHeaders = [("Vary","Origin"),("Vary","X-Origin"),("Vary","Referer"),("Content-Type","application/json; charset=UTF-8"),("Content-Encoding","gzip"),("Date","Wed, 12 Aug 2020 17:55:49 GMT"),("Server","ESF"),("Cache-Control","private"),("X-XSS-Protection","0"),("X-Frame-Options","SAMEORIGIN"),("X-Content-Type-Options","nosniff"),("Alt-Svc","h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43""),("Transfer-Encoding","chunked")], _serviceBody = Just "{\n "error": {\n "code": 400,\n "message": "Required parameter is missing",\n "errors": [\n {\n "message": "Required parameter is missing",\n "domain": "global",\n "reason": "required"\n }\n ],\n "status": "INVALID_ARGUMENT"\n }\n}\n"})

gogol version is 0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant