Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b59ddf

Browse files
committed
It may not be obvious to you, but the plpython regression tests
include output that vary depending on the python build one isrunning. Basically, the order of keys in a dictionary isnon-deterministic, and that part of the test fails for me regularly.I rewrote the test to work around this problem, and include a patchfile with that change and the change to the expected otuput as well.Mike Meyer
1 parentc75d654 commit9b59ddf

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

‎src/pl/plpython/feature.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ select import_test_two(users) from users where fname = 'willem';
5454
(1 row)
5555

5656
select argument_test_one(users, fname, lname) from users where lname = 'doe' order by 1;
57-
argument_test_one
58-
-------------------------------------------------------------------------------------
59-
jane doe => {'fname': 'jane', 'userid': 1, 'lname': 'doe', 'username': 'j_doe'}
60-
john doe => {'fname': 'john', 'userid': 2, 'lname': 'doe', 'username': 'johnd'}
61-
willem doe => {'fname': 'willem', 'userid': 3, 'lname': 'doe', 'username': 'w_doe'}
57+
argument_test_one
58+
-----------------------------------------------------------------------
59+
jane doe => {fname:jane, lname: doe, userid: 1,username:j_doe}
60+
john doe => {fname:john, lname: doe, userid: 2,username:johnd}
61+
willem doe => {fname:willem, lname: doe, userid: 3,username:w_doe}
6262
(3 rows)
6363

6464
select nested_call_one('pass this along');

‎src/pl/plpython/plpython_function.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ return "sha hash of " + plain + " is " + digest.hexdigest()'
8282

8383
CREATEFUNCTIONargument_test_one(users,text,text) RETURNStext
8484
AS
85-
'words = args[1] + " " + args[2] + " => " + str(args[0])
85+
'keys = args[0].keys()
86+
keys.sort()
87+
out = []
88+
for key in keys:
89+
out.append("%s: %s" % (key, args[0][key]))
90+
words = args[1] + " " + args[2] + " => {" + ", ".join(out) + "}"
8691
return words'
8792
LANGUAGE'plpython';
8893

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp