Comments (2)
I have managed to run into this same error without concurrency:
from google.cloud import spanner
client = spanner.Client()
instance = client.instance(INSTANCE)
database = instance.database(DATABASE)
sess = database.session()
sess.create()
txn = sess.transaction()
txn.begin()
try:
txn.execute_update(
"INSERT Singers (SingerId, FirstName, LastName) VALUES "
"(10, 'Taylor', 'Swift'),"
)
except Exception as e:
print("error:")
print(e)
txn.execute_update(
"INSERT Singers (SingerId, FirstName, LastName) VALUES "
"(10, 'Taylor', 'Swift')"
)
txn.commit()
The output is:
error:
400 Syntax error: Expected \"(\" but got end of statement [at 1:79]\nINSERT Singers (SingerId, FirstName, LastName) VALUES (10, \'Taylor\', \'Swift\'),\n
and raises:
google.api_core.exceptions.InvalidArgument: 400 Previously received a different request with this seqno. seqno=0
The problem seems to arise when a execute_sql
, execute_batch_dml
, or execute_streaming_sql
call made by a Transaction or Snapshot raises an exception as it fails to increment _execute_sql_count
. I am looking into a possible fix.
Thanks for finding this!
from python-spanner.
@skuruppu @larkee I am getting this error quite a lot with the spanner-django project as per https://travis-ci.com/orijtech/spanner-orm/jobs/283644877#L611 which you have access to with your Github accounts.
from python-spanner.
Related Issues (20)
- Warning: a recent release failed HOT 1
- Local Spanner Emulator doesn't support untyped params for datetime and date HOT 2
- Provide a complete/high-level async client API HOT 2
- Receiving Error: MultiThreadedRendezvous of RPC that terminated with: status = StatusCode.UNAVAILABLE HOT 3
- Improper initialisation of JsonObject when param itself is JsonObject whose top level is a list
- tests.system.test_session_api: test_transaction_batch_update_w_parent_span failed HOT 1
- System test `test_iam_policy` fails with `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python`
- Remove dependency of spanner_sbapi from spanner_v1
- ExecuteSqlRequest params only takes strings
- spanner_v1/trace: trace_call span attributes are hard-coded and don't follow OpenTelemetry semantic conventions; should instead use incorrect standardized OpenTelemetry attributes
- spanner_v1/trace: allow option for extended tracing which will allow recording the SQL statement if provided
- observability: please update to a newer version of opentelemetry because the current dependency opentelemetry-api:1.1.0 is from April 2021 (3+ years ago)
- Missing retry during ExecuteStreamingSql call in _restart_on_unavailable
- [spanner_dbapi] While running a query that contains just comment, it causes an IndexError exception HOT 1
- [Refactoring] Create a copy of samples/samples/testdata in tests/testdata
- Create samples for Cloud Spanner Graph
- tests.system.test_session_api: test_transaction_execute_update_read_commit failed HOT 1
- Segmentation Fault while running pytest with coverage
- tests.system.test_session_api: test_transaction_batch_update_dml_returning failed HOT 1
- No module named "grpc_interceptor" error HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-spanner.