Commit fe7bfd0
fix: remove stray debug print in RangeQueryParameter constructor (#17973)
`RangeQueryParameter.__init__` in `google-cloud-bigquery` has a leftover
debug `print()`:
```python
self.range_element_type = self._parse_range_element_type(range_element_type)
print(self.range_element_type.type_._type) # <- this
self.start = start
```
It fires on every construction, so anyone building a RANGE query
parameter gets the element type dumped to stdout. Easy to reproduce:
```python
>>> from google.cloud.bigquery.query import RangeQueryParameter
>>> RangeQueryParameter(range_element_type="DATE", start="2016-08-11")
DATE
```
This removes the line and adds a small regression test that asserts
nothing is printed during construction. Verified the test fails on the
current code (`Expected 'print' to not have been called. Called 1 times.
Calls: [call('DATE')]`) and passes after the removal. All existing
RangeQueryParameter tests still pass, black is clean.
Co-authored-by: Anthonios Partheniou <partheniou@google.com>1 parent 6ff5815 commit fe7bfd0
2 files changed
Lines changed: 7 additions & 1 deletion
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1020 | 1020 | | |
1021 | 1021 | | |
1022 | 1022 | | |
1023 | | - | |
1024 | 1023 | | |
1025 | 1024 | | |
1026 | 1025 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
781 | 788 | | |
782 | 789 | | |
783 | 790 | | |
| |||
0 commit comments