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

gracefully handle artifacts' API unavailability #709

Merged
merged 8 commits into from
Sep 20, 2021
Merged

Conversation

pkasprzyk
Copy link
Contributor

@pkasprzyk pkasprzyk commented Sep 16, 2021

HubertJaworski
HubertJaworski previously approved these changes Sep 16, 2021
build_operation_url(self._client_config.api_url, self.ARTIFACTS_SWAGGER_PATH),
self._http_client
)
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of different things can go wrong here. Exception does not necessarily mean artifacts are not supported.
Maybe we should add list of supported features to config returned from backend.
@Herudaio how urgent is it to make new clients work for onprems?

@@ -184,11 +193,18 @@ def __init__(self, credentials: Credentials, proxies: Optional[Dict[str, str]] =
python_version=platform.python_version())
self._http_client.session.headers.update({'User-Agent': user_agent})

if self.missing_features:
warnings.warn(NeptuneFeaturesNotAvailableWarning(self.missing_features).message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a fan of printing this in every single Run.

Copy link
Contributor Author

@pkasprzyk pkasprzyk Sep 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's (now) a python warning, so the user can setup it to print only once
warnings.simplefilter("once", NeptuneFeaturesNotAvailableWarning)
or choose to ignore it alltogether
warnings.simplefilter("ignore", NeptuneFeaturesNotAvailableWarning)

either way, your fight is with spec, not me ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec has changed, so removing

@pkasprzyk pkasprzyk merged commit 5d9ba8b into master Sep 20, 2021
@pkasprzyk pkasprzyk deleted the pk/npt-10843 branch September 20, 2021 14:01
@pkasprzyk pkasprzyk mentioned this pull request Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants