| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -441,7 +441,7 @@ def _format_operation(operation, parameters=None): | |||
| 441 | 441 | if a parameter used in the operation is not found in the | |
| 442 | 442 | ``parameters`` argument. | |
| 443 | 443 | """ | |
| 444 | - if parameters is None: | ||
| 444 | + if parameters is None or len(parameters) == 0: | ||
| 445 | 445 | return operation | |
| 446 | 446 | ||
| 447 | 447 | if isinstance(parameters, collections_abc.Mapping): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -601,3 +601,9 @@ def test__format_operation_w_too_short_sequence(self): | |||
| 601 | 601 | "SELECT %s, %s;", | |
| 602 | 602 | ("hello",), | |
| 603 | 603 | ) | |
| 604 | + | ||
| 605 | + def test__format_operation_w_empty_dict(self): | ||
| 606 | + from google.cloud.bigquery.dbapi import cursor | ||
| 607 | + | ||
| 608 | + formatted_operation = cursor._format_operation("SELECT '%f'", {}) | ||
| 609 | + self.assertEqual(formatted_operation, "SELECT '%f'") | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments