Skip to content

Commit

Permalink
Merge branch '0.24' into auto-transpiling
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Sep 27, 2024
2 parents 05c1242 + 32983d8 commit 8278867
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adds support for optional fields to properly optional
>>>>>>> 0.24
### Migration

#### Convert type of value from form fields before using it

To read a value from formFields where id is `name`,

Before:

```python
# form_fields should be of type List[FormField]
name: str | None = None
for field in form_fields:
if field.id == 'name':
name = field.value
```

After:

```python
# form_fields should be of type List[FormField]
name: str | None = None
for field in form_fields:
if field.id == 'name':
# Check type to ensure it's of type string
value_to_consume = field.value
if not isinstance(value_to_consume, str):
# Throw error
raise ValueError('name needs to be a string')
name = str(value_to_consume)
```

## [0.24.2] - 2024-09-03
- Makes optional input form fields truly optional instead of just being able to accept `""`.

Expand Down

0 comments on commit 8278867

Please sign in to comment.