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

add simple validate_bookstore function & tests (not traitlets validate) #44

Merged
merged 2 commits into from
Jan 29, 2019

Conversation

mpacer
Copy link
Member

@mpacer mpacer commented Jan 29, 2019

@rgbkrkr asked to have a way to test for whether bookstore is properly configured over in the nteract_on_jupyter handler.

I felt like the business logic for that should live in the bookstore repo… seemed like the best way to do that would be to expose a validation function.

Since it requires that a collection of values are set appropriately, I figured it was going to be more straightforward to write a quick function rather than define custom validation functions for each one of the traitlets in question.

In the long run, we might want to go in the traitlets direction… but, for now, this seemed like a good way to delay validation and expose it to another library.

@mpacer mpacer requested review from rgbkrk and willingc January 29, 2019 18:48
Copy link
Member

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Looks good to me. One small request for a docstring, and then this is ready to merge.

@@ -36,3 +36,12 @@ class BookstoreSettings(LoggingConfigurable):
16,
help="Maximum number of threads for the threadpool allocated for S3 read/writes",
).tag(config=True)


def validate_bookstore(settings: BookstoreSettings):
Copy link
Member

Choose a reason for hiding this comment

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

Let's go ahead and add a simple docstring for the autodocs. Examples are in the papermill docs PR that is soon to merge. numpy format.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great idea!

Copy link
Member

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Beautiful updates. So happy to merge.

@willingc willingc merged commit 70db713 into nteract:master Jan 29, 2019
@rgbkrk
Copy link
Member

rgbkrk commented Jan 29, 2019

Sweet, does this mean we just pluck the bookstore settings object off the app config in nteract on jupyter then use this validation function?

@mpacer mpacer modified the milestones: 2.2.1, 2.2.0 Jun 28, 2019
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