-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: spannerIssues related to the googleapis/python-spanner API.Issues related to the googleapis/python-spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
As mentioned in the docstring Case c return the dict with the info like homogenous, homogenous etc:
python-spanner/google/cloud/spanner_dbapi/parse_utils.py
Lines 235 to 244 in 1f80a39
| Case c) | |
| SQL: INSERT INTO T (f1, f2) VALUES (%s, %s), (%s, %s) | |
| Params: ['a', 'b', 'c', 'd'] | |
| it produces: | |
| { | |
| 'homogenous': True, | |
| 'table': 'T', | |
| 'columns': ['f1', 'f2'], | |
| 'values': [('a', 'b',), ('c', 'd',)], | |
| } |
Where code of Case c returns sql_params_list:
python-spanner/google/cloud/spanner_dbapi/parse_utils.py
Lines 305 to 321 in 1f80a39
| if values.homogenous(): | |
| # Case c) | |
| columns = [mi.strip(" `") for mi in match.group("columns").split(",")] | |
| sql_params_list = [] | |
| insert_sql_preamble = "INSERT INTO %s (%s) VALUES %s" % ( | |
| match.group("table_name"), | |
| match.group("columns"), | |
| values.argv[0], | |
| ) | |
| values_pyformat = [str(arg) for arg in values.argv] | |
| rows_list = rows_for_insert_or_update(columns, params, values_pyformat) | |
| insert_sql_preamble = sanitize_literals_for_upload(insert_sql_preamble) | |
| for row in rows_list: | |
| sql_params_list.append((insert_sql_preamble, row)) | |
| return {"sql_params_list": sql_params_list} |
So it never execute for the homogeneous insert
| _execute_insert_homogenous(transaction, parts) |
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: spannerIssues related to the googleapis/python-spanner API.Issues related to the googleapis/python-spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.