Commit e89ab7e
BigQuery: added methods for getting keys, items and dict (#4393)
* added methods for getting keys, items and dict
This change enables to retrieve the row as a dict and iterate the keys and/or items, like with a normal dict; in other words, making the Row object a dict-like object:
>>> row.dict()
{'name': 'Isabel', 'profession': 'bridge builder'}
>>> for k, v in row.items():
>>> for k in row.keys():
* fixed row length
* removed whitespace from blank lines
* removed trailing whitespace
* responding to failed cover check
* added docstrings
* update unit tests
* Update test_table.py
* .keys() and .items() into generators
* get method for Row
* get method for Row
* get method for Row
* Update table.py
* Update test_table.py
* Update test_table.py1 parent 36c4abd commit e89ab7e
File tree
2 files changed
+48
-0
lines changed- bigquery
- google/cloud/bigquery
- tests/unit
2 files changed
+48
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
788 | 829 | | |
789 | 830 | | |
790 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
768 | 775 | | |
769 | 776 | | |
770 | 777 | | |
| |||
0 commit comments