Check the `unique` keyword parameter -- may be a sequence or string.
(self, unique)
| 326 | return sr |
| 327 | |
| 328 | def check_unique(self, unique): |
| 329 | "Check the `unique` keyword parameter -- may be a sequence or string." |
| 330 | if isinstance(unique, (list, tuple)): |
| 331 | # List of fields to determine uniqueness with |
| 332 | for attr in unique: |
| 333 | if attr not in self.mapping: |
| 334 | raise ValueError |
| 335 | elif isinstance(unique, str): |
| 336 | # Only a single field passed in. |
| 337 | if unique not in self.mapping: |
| 338 | raise ValueError |
| 339 | else: |
| 340 | raise TypeError( |
| 341 | "Unique keyword argument must be set with a tuple, list, or string." |
| 342 | ) |
| 343 | |
| 344 | # Keyword argument retrieval routines. |
| 345 | def feature_kwargs(self, feat): |