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

fix: convert all content values to strings #303

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

mmikita95
Copy link
Contributor

Adds a _prepare_value for StreamsyncUIManager class, to utilize inside _create_component. For dict, it uses json.dumps, and casts to str for the rest of the types. Allows to use Python types when defining content for CMCs, for example:

ui.SliderInput({"minValue": 0, "maxValue": 300, "stepSize": 1}) # uses int literals

By default, this triggers TypeError: template.replace is not a function on the frontend; this fix allows to avoid it.

@ramedina86 ramedina86 merged commit 8d3801a into writer:dev Mar 12, 2024
15 checks passed
This pull request was closed.
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