sdk-codegen icon indicating copy to clipboard operation
sdk-codegen copied to clipboard

Improve error message when you try to start_pdt_build() of ephemeral dt

Open dwmintz opened this issue 2 years ago • 4 comments

As far as I can tell, there's no way to tell from the API whether a particular derived table is ephemeral or has a persistence strategy. If you're attempting to orchestrate the rebuilding of PDTs from outside Looker (like with Airflow), you can fetch the DAG for the model, but it returns ephemeral, as well as persistent derived tables.

Then when you tell Looker to start_pdt_build() on one of the derived tables that has no persistence strategy defined, you get the not very descriptive looker_sdk.error.SDKError: {"message":"An error has occurred.","documentation_url":"https://docs.looker.com/"}

It'd be lovely if that error message told you that the DT in question isn't persisted so you could skip over it.

dwmintz avatar Jul 03 '22 21:07 dwmintz

well hello @dwmintz :-)

I'll let our devrel team provide official guidance (@jkaster, @jeremytchang, @fabio-looker) but in this case the SDK is just reporting what the Looker API says so it's a feature/bug for whichever team owns the endpoint behind start_pdt_build() these days (model dev? query management?) The logistics of connecting this sdk-codegen issue with that internal bug are not totally clear to me but if you don't get a response in a few days I'll attempt to make the connection.

joeldodge79 avatar Jul 07 '22 15:07 joeldodge79

👋

Great, thanks Joel. I'll also bug Maire, since I know she's thinking about broader orchestration-outside-Looker stuff.

dwmintz avatar Jul 07 '22 15:07 dwmintz

We are actually looking to improve API error messages across the board, though as Joel mentions, many of the specifics will be up to the teams responsible for the particular endpoints.

(Of course, if there are any missing features in my LookML parser that could help, lemme know!)

fabio-looker avatar Jul 07 '22 16:07 fabio-looker

Mostly trying to get things done via the API rather than needing access to the repo. Though I guess with GH Actions now, you could trigger a parse of the model each time there's a merge and push the resulting bits of the output that you care about to S3 or somewhere that Airflow could get it.

Having said that, the "I'm not gonna build that DT because it's ephemeral" seems like kind of a no-brainer error message and would be the simplest thing here.

dwmintz avatar Jul 08 '22 13:07 dwmintz