mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-26 23:59:58 +00:00
use only s3 in boto3-stubs and update mypy
Newer version of mypy fixes buggy error when trying to update only boto3 stubs. However it brings new checks and starts to yell when we index into cusror.fetchone without checking for None first. So this introduces a wrapper to simplify quering for scalar values. I tried to use cursor_factory connection argument but without success. There can be a better way to do that, but this looks the simplest
This commit is contained in:
committed by
Dmitry Rodionov
parent
e73b95a09d
commit
092a9b74d3
@@ -9,6 +9,8 @@ import psycopg2.extras
|
||||
import random
|
||||
import time
|
||||
|
||||
from fixtures.utils import query_scalar
|
||||
|
||||
|
||||
# This is a clear-box test that demonstrates the worst case scenario for the
|
||||
# "1 segment per layer" implementation of the pageserver. It writes to random
|
||||
@@ -59,9 +61,7 @@ def test_random_writes(neon_with_baseline: PgCompare):
|
||||
rows_inserted += rows_to_insert
|
||||
|
||||
# Get table size (can't be predicted because padding and alignment)
|
||||
cur.execute("SELECT pg_relation_size('Big');")
|
||||
row = cur.fetchone()
|
||||
table_size = row[0]
|
||||
table_size = query_scalar(cur, "SELECT pg_relation_size('Big')")
|
||||
env.zenbenchmark.record("table_size", table_size, 'bytes', MetricReport.TEST_PARAM)
|
||||
|
||||
# Decide how much to write, based on knowledge of pageserver implementation.
|
||||
|
||||
Reference in New Issue
Block a user