diff --git a/tests/fix_crdb.py b/tests/fix_crdb.py index 5cf9d087a..8a13c28c9 100644 --- a/tests/fix_crdb.py +++ b/tests/fix_crdb.py @@ -101,6 +101,7 @@ def crdb_scs_off(*args): "hstore": 41284, "infinity date": 41564, "interval style": 35807, + "json array": 23468, "large objects": 243, "negative interval": 81577, "nested array": 32552, diff --git a/tests/fix_faker.py b/tests/fix_faker.py index b076b374d..0c263bbb0 100644 --- a/tests/fix_faker.py +++ b/tests/fix_faker.py @@ -15,6 +15,7 @@ from psycopg.adapt import PyFormat from psycopg._compat import Deque from psycopg.types.range import Range +from psycopg.types.json import Json, Jsonb from psycopg.types.numeric import Int4, Int8 from psycopg.types.multirange import Multirange @@ -485,6 +486,11 @@ def schema_list(self, cls): # There may be rounding errors or problems with inf. continue + # CRDB doesn't support arrays of json + # https://github.com/cockroachdb/cockroach/issues/23468 + if self.conn.info.vendor == "CockroachDB" and scls in (Json, Jsonb): + continue + schema = self.make_schema(scls) if schema is not None: break diff --git a/tests/types/test_json.py b/tests/types/test_json.py index a23ec0ad7..9e707e93f 100644 --- a/tests/types/test_json.py +++ b/tests/types/test_json.py @@ -47,6 +47,7 @@ def test_dump(conn, val, wrapper, fmt_in): assert cur.fetchone()[0] is True +@pytest.mark.crdb("skip", reason="json array") @pytest.mark.parametrize("val", samples) @pytest.mark.parametrize("wrapper", ["Json", "Jsonb"]) @pytest.mark.parametrize("fmt_in", PyFormat) @@ -70,6 +71,7 @@ def test_load(conn, val, jtype, fmt_out): assert cur.fetchone()[0] == json.loads(val) +@pytest.mark.crdb("skip", reason="json array") @pytest.mark.parametrize("val", samples) @pytest.mark.parametrize("jtype", ["json", "jsonb"]) @pytest.mark.parametrize("fmt_out", pq.Format)