| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
I wouldn't say this "closes #3396". That asks us to accept dictionaries in insert_data.
We should either:
Sorry, something went wrong.
|
|
||
| :rtype: tuple | ||
| :returns: Tuple matching the table's schema | ||
| :raises: ValueError if table's schema is not set |
| :param mapping: Mapping of row data. | ||
|
|
||
| :rtype: tuple | ||
| :returns: Tuple matching the table's schema |
| row.append(mapping[field.name]) | ||
| elif field.mode == 'REPEATED': | ||
| row.append(mapping.get(field.name, ())) | ||
| else: # NULLABLE |
| row.append(mapping.get(field.name, ())) | ||
| else: # NULLABLE | ||
| row.append(mapping.get(field.name)) | ||
| return tuple(row) |
| with self.assertRaises(ValueError) as exc: | ||
| table.row_from_mapping(MAPPING) | ||
|
|
||
| self.assertEqual(exc.exception.args, (_TABLE_HAS_NO_SCHEMA,)) |
|
Given a row_from_mapping helper method, the insert_data_from_mappings one is redundant: it is the equivalent of: table.insert_data([table.row_from_mapping(mapping) for mapping in mapping_list])I'm proposing closing #3396 with a note to that effect. |
Sorry, something went wrong.
Sorry, something went wrong.
|
If LGTY @lukesneeringer then I'm OK with it |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #3396.