Content-Length: 294395 | pFad | http://github.com/postgrespro/postgres/commit/e81fc9b9dbf9d744dcc9fb210e4353a350be1e22

E0 Fix jsonb_plpython tests on older Python versions · postgrespro/postgres@e81fc9b · GitHub
Skip to content

Commit e81fc9b

Browse files
committed
Fix jsonb_plpython tests on older Python versions
Rewrite one test to avoid a case where some Python versions have output format differences (Decimal('1') vs Decimal("1")).
1 parent 3f44e3d commit e81fc9b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

contrib/jsonb_plpython/expected/jsonb_plpython.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ LANGUAGE plpythonu
66
TRANSFORM FOR TYPE jsonb
77
AS $$
88
assert isinstance(val, dict)
9-
plpy.info(sorted(val.items()))
9+
assert(val == {'a': 1, 'c': 'NULL'})
1010
return len(val)
1111
$$;
1212
SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
13-
INFO: [('a', Decimal('1')), ('c', 'NULL')]
1413
test1
1514
-------
1615
2

contrib/jsonb_plpython/sql/jsonb_plpython.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LANGUAGE plpythonu
66
TRANSFORM FOR TYPE jsonb
77
AS $$
88
assert isinstance(val, dict)
9-
plpy.info(sorted(val.items()))
9+
assert(val == {'a': 1, 'c': 'NULL'})
1010
return len(val)
1111
$$;
1212

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/e81fc9b9dbf9d744dcc9fb210e4353a350be1e22

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy