Skip to content

Commit b3cf016

Browse files
author
Johannes Kroll
committed
rename array_column in php because of http://php.net/manual/en/function.array-column.php in php5.5. rename python version too for consistency
1 parent a6dc5b5 commit b3cf016

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

php/gpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,7 @@ public static function new_slave_connection( $command, $cwd = null, $env = null
17921792
*
17931793
* @return an array consisting of the values of column $col from each row in $a
17941794
*/
1795-
function array_column($a, $col) {
1795+
function extract_array_column($a, $col) {
17961796
$column = array();
17971797

17981798
foreach ( $a as $k => $x ) {

php/test/gpServer.test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ public function testListGraphs() {
120120
$gp2 = $this->newConnection();
121121

122122
$graphs = $gp2->capture_list_graphs();
123-
$graphs = array_column( $graphs, 0 );
123+
$graphs = extract_array_column( $graphs, 0 );
124124
$this->assertTrue( in_array( $gpTestGraphName, $graphs ), "test table $gpTestGraphName should be in the list" );
125125

126126
$this->gp->drop_graph($gpTestGraphName);
127127
$graphs = $gp2->capture_list_graphs();
128128
#print "graphs: " . var_export($graphs, true) . "\n";
129129

130-
$graphs = array_column( $graphs, 0 );
130+
$graphs = extract_array_column( $graphs, 0 );
131131

132132
#print "graphs: " . var_export($graphs, true) . "\n";
133133

php/test/gpSlave.test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testCapture() {
4747
$this->assertNotNull( $a );
4848
$this->assertType( 'array', $a );
4949

50-
$a = array_column( $a, 0 );
50+
$a = extract_array_column( $a, 0 );
5151
$this->assertEquals( array(11, 12), $a, "unexpected response for list_successors(1): " . var_export($a, true) );
5252

5353
// two column data

python/gp/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ def new_slave_connection(command, cwd=None, env=None): #static #OK
20682068
"""
20692069
return Connection(SlaveTransport(command, cwd, env))
20702070

2071-
def array_column(a, col):
2071+
def extract_array_column(a, col):
20722072
"""Extracts a column from a tabular structure
20732073
20742074
@type a: list/tuple

python/gp/tests/server_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ def test_listGraphs(self):
125125

126126
gp2 = self.newConnection()
127127
graphs = gp2.capture_list_graphs()
128-
graphs = array_column(graphs, 0)
128+
graphs = extract_array_column(graphs, 0)
129129
self.assertTrue( test_graph_name in graphs,
130130
"test table test_graph_name should be in the list" )
131131

132132
self.gp.drop_graph(test_graph_name)
133133
graphs = gp2.capture_list_graphs()
134134
#print "graphs: " . var_export($graphs, true) . "\n"
135135

136-
graphs = array_column( graphs, 0 )
136+
graphs = extract_array_column( graphs, 0 )
137137

138138
#print "graphs: " . var_export($graphs, true) . "\n"
139139

python/gp/tests/slave_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_capture(self):
5050
self.assertNotNone( a )
5151
self.assertIsInstance(a, (list,tuple))
5252

53-
a = array_column( a, 0 )
53+
a = extract_array_column( a, 0 )
5454
self.assertEquals( [11, 12], a,
5555
"unexpected response for list_successors(1): %s" % a )
5656

python/test/ServerTest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ def test_listGraphs(self):
125125

126126
gp2 = self.newConnection()
127127
graphs = gp2.capture_list_graphs()
128-
graphs = array_column(graphs, 0)
128+
graphs = extract_array_column(graphs, 0)
129129
self.assertTrue( TestGraphName in graphs,
130130
"test table TestGraphName should be in the list" )
131131

132132
self.gp.drop_graph(TestGraphName)
133133
graphs = gp2.capture_list_graphs()
134134
#print "graphs: " . var_export($graphs, true) . "\n"
135135

136-
graphs = array_column( graphs, 0 )
136+
graphs = extract_array_column( graphs, 0 )
137137

138138
#print "graphs: " . var_export($graphs, true) . "\n"
139139

python/test/SlaveTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_capture(self):
5050
self.assertNotNone( a )
5151
self.assertIsInstance(a, (list,tuple))
5252

53-
a = array_column( a, 0 )
53+
a = extract_array_column( a, 0 )
5454
self.assertEquals( [11, 12], a,
5555
"unexpected response for list_successors(1): %s" % a )
5656

0 commit comments

Comments
 (0)