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

fix(ingest/looker) : Handle DeserializeError to improve error reporting. #11457

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
)

from looker_sdk.error import SDKError
from looker_sdk.rtl.serialize import DeserializeError
from looker_sdk.sdk.api40.models import (
LookmlModelExplore,
LookmlModelExploreField,
Expand Down Expand Up @@ -1131,7 +1132,16 @@ def from_api( # noqa: C901
logger.warning(
f"Failed to extract explore {explore_name} from model {model}: {e}"
)

except DeserializeError as e:
reporter.warning(
title="Failed to fetch explore from the Looker API",
message=(
"An error occurred while extracting the explore from the model. "
"Please check the explore and model configurations."
),
context=f"Explore: {explore_name}, Model: {model}",
exc=e,
)
except AssertionError:
reporter.report_warning(
title="Unable to find Views",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)

from looker_sdk.error import SDKError
from looker_sdk.rtl.serialize import DeserializeError
from looker_sdk.sdk.api40.models import (
Dashboard,
DashboardElement,
Expand Down Expand Up @@ -1288,12 +1289,13 @@ def process_dashboard(
dashboard_id=dashboard_id,
fields=fields,
)
except SDKError:
except (SDKError, DeserializeError) as e:
# A looker dashboard could be deleted in between the list and the get
self.reporter.report_warning(
title="Error Loading Dashboard",
title="Failed to fetch dashboard from the Looker API",
message="Error occurred while attempting to loading dashboard from Looker API. Skipping.",
context=f"Dashboard ID: {dashboard_id}",
sagar-salvi-apptware marked this conversation as resolved.
Show resolved Hide resolved
exc=e,
)
return [], None, dashboard_id, start_time, datetime.datetime.now()

Expand Down
Loading