Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

[#72]: https://github.com/SAP/data-attribute-recommendation-python-sdk/pull/72

### Changed

* Improve logging: quieten OnlineCredentialsSource, make polling explicit [#81]

[#81] : https://github.com/SAP/data-attribute-recommendation-python-sdk/pull/81

## [0.7.0]

Expand Down
3 changes: 3 additions & 0 deletions sap/aibus/dar/client/data_manager_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ def polling_function() -> dict:
)
self.log.error(msg)
raise DatasetValidationFailed(msg)
self.log.info(
"Dataset '%s' has status '%s'.", response["id"], response["status"]
)
return response

def upload_data_and_validate(
Expand Down
14 changes: 8 additions & 6 deletions sap/aibus/dar/client/model_manager_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,12 @@ def polling_function():
self.log.exception(timeout_msg)
raise TrainingJobTimeOut(timeout_msg)

msg = "Job '{}' has status: '{}'".format(job_id, result["status"])
if self.is_job_failed(result):
fail_msg = "Job '{}' has status: '{}'".format(job_id, result["status"])
self.log.error(fail_msg)
raise TrainingJobFailed(fail_msg)
self.log.error(msg)
raise TrainingJobFailed(msg)

self.log.info(msg)

return result

Expand Down Expand Up @@ -444,13 +446,13 @@ def polling_function():
self.log.exception(msg)
raise DeploymentTimeOut(msg) from exc

msg = "Deployment '{}' has status: {}".format(deployment_id, response["status"])
if self.is_deployment_failed(response):
msg = "Deployment '{}' has status: {}".format(
deployment_id, response["status"]
)
self.log.error(msg)
raise DeploymentFailed(msg)

self.log.info(msg)

return response

def deploy_and_wait(self, model_name: str) -> dict:
Expand Down
4 changes: 2 additions & 2 deletions sap/aibus/dar/client/util/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def token(self) -> str:

def _fetch_token_from_auth_server(self) -> dict:
url = self.url + "/oauth/token?grant_type=client_credentials"
self.log.info('Retrieving token from URL: "%s"', url)
self.log.debug('Retrieving token from URL: "%s"', url)
response = self.session.get(url, auth=(self.clientid, self.clientsecret))
response.raise_for_status()
payload = response.json()
self.log.info(
self.log.debug(
'Got token for clientid "%s" with HTTP status "%s" and scope "%s"',
self.clientid,
response.status_code,
Expand Down