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

feat(ingest/looker): add retries to API calls #9606

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix retries in test
  • Loading branch information
hsheth2 committed Jan 11, 2024
commit 89666738e9ca6511122c7e3d8684996aeda0be8a
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,18 @@ def __init__(self, config: LookerAPIConfig) -> None:

# Somewhat hacky mechanism for enabling retries on the Looker SDK.
# Unfortunately, it doesn't expose a cleaner way to do this.
assert isinstance(
if isinstance(
self.client.transport, looker_requests_transport.RequestsTransport
)
adapter = HTTPAdapter(
max_retries=self.config.max_retries,
)
self.client.transport.session.mount("http://", adapter)
self.client.transport.session.mount("https://", adapter)
):
adapter = HTTPAdapter(
max_retries=self.config.max_retries,
)
self.client.transport.session.mount("http://", adapter)
self.client.transport.session.mount("https://", adapter)
elif self.config.max_retries > 0:
raise ConfigurationError(
"Unable to configure retries on the Looker SDK transport."
)

self.transport_options = (
config.transport_options.get_transport_options()
Expand Down
1 change: 1 addition & 0 deletions metadata-ingestion/tests/integration/lookml/test_lookml.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ def ingestion_test(
"client_id": "fake_client_id",
"client_secret": "fake_secret",
"base_url": "fake_account.looker.com",
"max_retries": 0,
},
"parse_table_names_from_sql": True,
"model_pattern": {"deny": ["data2"]},
Expand Down
Loading