Skip to content

Commit 73d6325

Browse files
committed
Prepare to handle is-meta and is-seed columns in CSV exports.
1 parent 9e8078b commit 73d6325

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
- Allow `pick_max` and `confidence` interval args to be set in `polis.run_clustering()`.
1616
- Allow `get_corrected_centroid_guesses()` to unflip each axis if correction not needed.
1717

18+
### Fixes
19+
- Handle when `is-meta` and `is-seed` columns arrive in CSV import.
20+
[`#55`](https://github.com/polis-community/red-dwarf/issues/55)
21+
1822
### Chores
1923

2024
- Update the release process instructions.

reddwarf/models.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ class Statement(BaseModel):
4848
)
4949
tweet_id: Optional[int] = None
5050
quote_src_url: Optional[str] = None
51-
is_seed: Optional[bool] = None
52-
is_meta: Optional[bool] = None
51+
is_seed: Optional[bool] = Field(
52+
default=None,
53+
validation_alias=AliasChoices('is_seed', 'is-seed'),
54+
)
55+
is_meta: Optional[bool] = Field(
56+
default=None,
57+
validation_alias=AliasChoices('is_meta', 'is-meta'),
58+
)
5359
lang: Optional[str] = None
5460
participant_id: IncrementingId = Field(
5561
validation_alias=AliasChoices('participant_id', 'pid', 'author-id'),

0 commit comments

Comments
 (0)