pyarrow-assert 0.3.7rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
|
|
1
|
+
import os
|
2
|
+
|
3
|
+
# Define the path to the README file relative to the package directory
|
4
|
+
readme_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.md")
|
5
|
+
|
6
|
+
# Read the content of the README file
|
7
|
+
try:
|
8
|
+
with open(readme_path, "r", encoding="utf-8") as f:
|
9
|
+
__doc__ = f.read()
|
10
|
+
except FileNotFoundError:
|
11
|
+
__doc__ = "README file not found."
|
pyarrow_assert/main.py
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
import argparse
|
2
|
+
import os
|
3
|
+
import ast
|
4
|
+
|
5
|
+
import pyarrow as pa
|
6
|
+
from dora import Node
|
7
|
+
|
8
|
+
RUNNER_CI = True if os.getenv("CI") == "true" else False
|
9
|
+
|
10
|
+
|
11
|
+
def main():
|
12
|
+
|
13
|
+
# Handle dynamic nodes, ask for the name of the node in the dataflow, and the same values as the ENV variables.
|
14
|
+
parser = argparse.ArgumentParser(description="Simple arrow sender")
|
15
|
+
|
16
|
+
parser.add_argument(
|
17
|
+
"--name",
|
18
|
+
type=str,
|
19
|
+
required=False,
|
20
|
+
help="The name of the node in the dataflow.",
|
21
|
+
default="arrow-assert",
|
22
|
+
)
|
23
|
+
parser.add_argument(
|
24
|
+
"--data",
|
25
|
+
type=str,
|
26
|
+
required=False,
|
27
|
+
help="Arrow Data as string.",
|
28
|
+
default="",
|
29
|
+
)
|
30
|
+
|
31
|
+
args = parser.parse_args()
|
32
|
+
|
33
|
+
data = os.getenv("DATA", args.data)
|
34
|
+
|
35
|
+
node = Node(
|
36
|
+
args.name
|
37
|
+
) # provide the name to connect to the dataflow if dynamic node
|
38
|
+
|
39
|
+
data = ast.literal_eval(data)
|
40
|
+
|
41
|
+
if isinstance(data, list):
|
42
|
+
data = pa.array(data) # initialize pyarrow array
|
43
|
+
elif isinstance(data, str):
|
44
|
+
data = pa.array([data])
|
45
|
+
elif isinstance(data, int):
|
46
|
+
data = pa.array([data])
|
47
|
+
elif isinstance(data, float):
|
48
|
+
data = pa.array([data])
|
49
|
+
else:
|
50
|
+
data = pa.array(data) # initialize pyarrow array
|
51
|
+
|
52
|
+
for event in node:
|
53
|
+
if event["type"] == "INPUT":
|
54
|
+
value = event["value"]
|
55
|
+
assert value == data, f"Expected {data}, got {value}"
|
56
|
+
|
57
|
+
|
58
|
+
if __name__ == "__main__":
|
59
|
+
main()
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: pyarrow-assert
|
3
|
+
Version: 0.3.7rc2
|
4
|
+
Summary: Dora Node for plotting text and bbox on image with OpenCV
|
5
|
+
Home-page: https://github.com/dora-rs/dora.git
|
6
|
+
License: MIT
|
7
|
+
Author: Haixuan Xavier Tao
|
8
|
+
Author-email: tao.xavier@outlook.com
|
9
|
+
Requires-Python: >=3.7,<4.0
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
12
|
+
Classifier: Programming Language :: Python :: 3.7
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
19
|
+
Requires-Dist: dora-rs (>=0.3.6,<0.4.0)
|
20
|
+
Requires-Dist: numpy (<2.0.0)
|
21
|
+
Requires-Dist: pyarrow (>=5.0.0)
|
22
|
+
Project-URL: Documentation, https://github.com/dora-rs/dora/blob/main/node-hub/pyarrow-assert/README.md
|
23
|
+
Description-Content-Type: text/markdown
|
24
|
+
|
25
|
+
# Dora Node for asserting arrow data.
|
26
|
+
|
27
|
+
This node assert that the DATA that is specified within the environment variable or from `--data` argument is the same as the data received.
|
28
|
+
|
29
|
+
Check example at [examples/pyarrow-test](examples/pyarrow-test)
|
30
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
pyarrow_assert/__init__.py,sha256=Gy4qL4vCeTyA5HR1Yp3ioL4-ClJyW8oi_38CzMuMsBM,358
|
2
|
+
pyarrow_assert/main.py,sha256=oWDBkBti9pkBSJmfX6K2CUd22MDnSe2edqRbBWU8awk,1436
|
3
|
+
pyarrow_assert-0.3.7rc2.dist-info/METADATA,sha256=PETdv46DxGCB1Yf2NCZX6St73xgRBFtViXynT1x7If8,1227
|
4
|
+
pyarrow_assert-0.3.7rc2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
5
|
+
pyarrow_assert-0.3.7rc2.dist-info/entry_points.txt,sha256=dGD80SYTdYcpkLqYZ0FN80X-3dSzBguukK1CbIj4xhk,59
|
6
|
+
pyarrow_assert-0.3.7rc2.dist-info/RECORD,,
|