-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HPCC-30721 Fix Python examples to use Python3
Signed-off-by: Jim DeFabia <[email protected]>
- Loading branch information
Jim DeFabia
committed
Oct 31, 2023
1 parent
4c17a2c
commit dda2c21
Showing
5 changed files
with
72 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
IMPORT Python; | ||
IMPORT Python3 as Python; | ||
|
||
/* | ||
This example illustrates and tests the use of embedded Python | ||
*/ | ||
|
||
// Mapping of exceptions from Python to ECL | ||
|
||
integer testThrow(integer val) := EMBED(Python) | ||
raise Exception('Error from Python') | ||
INTEGER testThrow(integer val) := EMBED(Python) | ||
raise Exception('Error from Python') | ||
ENDEMBED; | ||
|
||
// Can't catch an expression(only a dataset) | ||
d := dataset([{ 1, '' }], { integer a, string m} ) : stored('nofold'); | ||
d := DATASET([{ 1, '' }], { INTEGER a, STRING m} ) : STORED('nofold'); | ||
|
||
d t := transform | ||
d t := TRANSFORM | ||
self.a := FAILCODE; | ||
self.m := FAILMESSAGE; | ||
self := []; | ||
end; | ||
|
||
catch(d(testThrow(a) = a), onfail(t)); | ||
CATCH(d(testThrow(a) = a), onfail(t)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters