-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitOrigin-RevId: f947ae61dbb299a54b9b6ca0ed6417cb6026887a
- Loading branch information
1 parent
bf4de1d
commit 5fdcaf0
Showing
7 changed files
with
104 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import subprocess as sp | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize("filename", ["unused_operators.py", "unused_operators_2.py"]) | ||
def test_some_operators_unused(filename: str): | ||
test_dir = os.path.dirname(os.path.abspath(__file__)) | ||
p = sp.run(["python3", f"{test_dir}/{filename}"], capture_output=True, check=True) | ||
assert ( | ||
"There are operators in the computation graph that haven't been used." | ||
+ " Use pathway.run() (or similar) to run the computation involving these nodes." | ||
) in p.stderr.decode() | ||
|
||
|
||
def test_all_operators_used(): | ||
test_dir = os.path.dirname(os.path.abspath(__file__)) | ||
p = sp.run( | ||
["python3", f"{test_dir}/used_operators.py"], capture_output=True, check=True | ||
) | ||
assert ( | ||
"There are operators in the computation graph that haven't been used." | ||
+ " Use pathway.run() (or similar) to run the computation involving these nodes." | ||
) not in p.stderr.decode() |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pathway as pw | ||
|
||
pw.debug.table_from_markdown( | ||
""" | ||
a | b | ||
1 | 2 | ||
""" | ||
) |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pathway as pw | ||
|
||
t = pw.debug.table_from_markdown( | ||
""" | ||
a | b | ||
1 | 2 | ||
""" | ||
) | ||
pw.debug.compute_and_print(t) | ||
t.with_columns(c=10) |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pathway as pw | ||
|
||
t = pw.debug.table_from_markdown( | ||
""" | ||
a | b | ||
1 | 2 | ||
""" | ||
) | ||
pw.debug.compute_and_print(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