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 ability to interpret json schema format #85

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

tharwan
Copy link

@tharwan tharwan commented Oct 31, 2023

for our use case it would be very useful to have date and time pickers available. Since Draft 7 of json schema allows for specific formats in the schema, I thought it might be nice to add ability to interpret the format specification for date-time, date and time.

Any suggestions to improve the implementation are highly welcome.

Copy link
Member

@dokempf dokempf left a comment

Choose a reason for hiding this comment

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

Thanks for providing this. I think it makes a great addition to the library. I added one question as a review comment but would merge and release soon after that is clarified.

if hasattr(ipywidgets, "DatePicker"):
available_fmt.append("date")
if hasattr(ipywidgets, "TimePicker"):
available_fmt.append("time")
Copy link
Member

Choose a reason for hiding this comment

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

What is the rationale behind these checks? Have the relevant widgets been introduced very recently into ipywidgets?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, they were added in 8. The test suite also runs agains 7, so in order to pass the tests I had to add these checks.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, I have slightly rewritten this in #87, as I would like to avoid doing to much hasattr stuff.

@dokempf dokempf mentioned this pull request Nov 3, 2023
@dokempf dokempf merged commit c785532 into ssciwr:main Nov 3, 2023
9 checks passed
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.

2 participants