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

Convert experiment not found log to a warning #2

Merged
merged 2 commits into from
May 17, 2021

Conversation

isugimpy
Copy link
Contributor

This should alleviate the problem in #1, I believe.

Copy link
Contributor

@spladug spladug left a comment

Choose a reason for hiding this comment

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

thanks! just a couple notes

@@ -23,6 +24,7 @@


logger = logging.getLogger(__name__)
logging.captureWarnings(True)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is done by baseplate-serve: https://github.com/reddit/baseplate.py/blob/develop/baseplate/server/__init__.py#L114

Generally, we shouldn't be setting global logging configuration from libraries -- applications should be the ones doing that. (baseplate-serve being an application though it's in the codebase of a library!)

@@ -132,7 +134,7 @@ def _get_experiment(self, name: str) -> Optional[Experiment]:
self._cfg_data = self._get_config()

if name not in self._cfg_data:
logger.info("Experiment <%r> not found in experiment config", name)
warnings.warn(f"Experiment <{repr(name)}> not found in experiment config", RuntimeWarning)
Copy link
Contributor

Choose a reason for hiding this comment

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

The docs say RuntimeWarning is "Base category for warnings about dubious runtime features." I think that sounds like it should be for interpreter-level stuff, not our use. It'd probably be fine to leave this un-specified (which defaults toUserWarning) or subclass our own ExperimentsWarning if we really want to be fancy.

@spladug spladug merged commit ca417f1 into reddit:develop May 17, 2021
@mrlevitas mrlevitas mentioned this pull request Apr 8, 2022
mrlevitas pushed a commit that referenced this pull request Apr 12, 2022
* holeeeeshititworks

* Cargo fixes

* added comment breadcrumb trail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants