-
-
Notifications
You must be signed in to change notification settings - Fork 813
Open
Description
I think these are failures just against SQLite: 3.25.3 (the earliest we suport, refs #2349) - update this note if we see them on alternative versions.
https://github.com/asg017/datasette/actions/runs/9503518697/job/26194122396
platform linux -- Python 3.11.9, pytest-8.2.2, pluggy-1.5.0
SQLite: 3.25.3
async def test_create_table_ignore_replace(ds_write, input, expected_rows_after):
# Create table with two rows
token = write_token(ds_write)
first_response = await ds_write.client.post(
"/data/-/create",
json={
"rows": [{"id": 1, "name": "Row 1"}, {"id": 2, "name": "Row 2"}],
"table": "test_insert_replace",
"pk": "id",
},
headers=_headers(token),
)
assert first_response.status_code == 201
ds_write._tracked_events = []
# Try a second time
second_response = await ds_write.client.post(
"/data/-/create",
json=input,
headers=_headers(token),
)
assert second_response.status_code == 201
# Check that the rows are as expected
rows = await ds_write.client.get("/data/test_insert_replace.json?_shape=array")
> assert rows.json() == expected_rows_after
E assert {'error': 'ne...'Invalid SQL'} == [{'id': 1, 'n... 'Row 3 new'}]
E
E Full diff:
E + {
E + 'error': 'near "from": syntax error',
E + 'ok': False,
E + 'status': 400,
E + 'title': 'Invalid SQL',
E + }
E - [
E - {
E - 'id': 1,
E - 'name': 'Row 1',
E - },
E - {
E - 'id': 2,
E - 'name': 'Row 2',
E - },
E - {
E - 'id': 3,
E - 'name': 'Row 3 new',
E - },
E - ]
tests/test_api_write.py:1424: AssertionError
----------------------------- Captured stderr call -----------------------------
ERROR: conn=<sqlite3.Connection object at 0x7ff0667a36a0>, sql = 'select rowid, from test_insert_replace order by rowid limit 101', params = {}: near "from": syntax error
=========================== short test summary info ============================
FAILED tests/test_api_write.py::test_create_table_ignore_replace[input0-expected_rows_after0] - assert {'error': 'ne...'Invalid SQL'} == [{'id': 1, 'n... 'Row 3 new'}]
Full diff:
+ {
+ 'error': 'near "from": syntax error',
+ 'ok': False,
+ 'status': 400,
+ 'title': 'Invalid SQL',
+ }
Reactions are currently unavailable