Skip to content

Commit 6d3d7a5

Browse files
authored
Don't throw on profile url link generation errors post upload (#1450)
## Description wrap the call to get the profile url in try/except and log as warning so we're not raising in the case where profile upload is successful. ## Changes try/except arount post upload profile url call default strings for results ## Related Address #1449 - [x] I have reviewed the [Guidelines for Contributing](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md).
1 parent a5ff5ef commit 6d3d7a5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

python/whylogs/api/whylabs/session/session.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,18 @@ def upload_batch_profile(self, profile: ResultSet) -> Union[UploadResult, NotSup
320320

321321
org_id = self.config.require_org_id()
322322
dataset_id = self.config.require_default_dataset_id()
323-
response: GetProfileObservatoryLinkResponse = self._whylabs_log_api.value.get_profile_observatory_link(
324-
dataset_id, org_id, request
325-
)
326323

324+
try:
325+
response: GetProfileObservatoryLinkResponse = self._whylabs_log_api.value.get_profile_observatory_link(
326+
dataset_id, org_id, request
327+
)
328+
except Exception as e:
329+
logger.info(f"Convenience profile links could not be generated for the sucessfully uploading profiles: {e}")
330+
331+
profile_url = response.observatory_url if response else ""
332+
individual_urls = response.individual_observatory_urls if response else None
327333
return UploadResult(
328-
viewing_url=response.observatory_url,
334+
viewing_url=profile_url,
329335
result=result,
330-
individual_viewing_urls=response.individual_observatory_urls,
336+
individual_viewing_urls=individual_urls,
331337
)

0 commit comments

Comments
 (0)