pyarrow-sender 0.3.6__py2.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_sender/main.py
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
import argparse
|
2
|
+
import os
|
3
|
+
import ast
|
4
|
+
|
5
|
+
import pyarrow as pa
|
6
|
+
|
7
|
+
from dora import Node
|
8
|
+
|
9
|
+
RUNNER_CI = True if os.getenv("CI") == "true" else False
|
10
|
+
|
11
|
+
|
12
|
+
def main():
|
13
|
+
|
14
|
+
# Handle dynamic nodes, ask for the name of the node in the dataflow, and the same values as the ENV variables.
|
15
|
+
parser = argparse.ArgumentParser(description="Simple arrow sender")
|
16
|
+
|
17
|
+
parser.add_argument(
|
18
|
+
"--name",
|
19
|
+
type=str,
|
20
|
+
required=False,
|
21
|
+
help="The name of the node in the dataflow.",
|
22
|
+
default="pyarrow-sender",
|
23
|
+
)
|
24
|
+
parser.add_argument(
|
25
|
+
"--data",
|
26
|
+
type=str,
|
27
|
+
required=False,
|
28
|
+
help="Arrow Data as string.",
|
29
|
+
default=None,
|
30
|
+
)
|
31
|
+
|
32
|
+
args = parser.parse_args()
|
33
|
+
|
34
|
+
data = os.getenv("DATA", args.data)
|
35
|
+
|
36
|
+
node = Node(
|
37
|
+
args.name
|
38
|
+
) # provide the name to connect to the dataflow if dynamic node
|
39
|
+
|
40
|
+
if data is None:
|
41
|
+
raise ValueError(
|
42
|
+
"No data provided. Please specify `DATA` environment argument or as `--data` argument"
|
43
|
+
)
|
44
|
+
else:
|
45
|
+
try:
|
46
|
+
data = ast.literal_eval(data)
|
47
|
+
except ValueError:
|
48
|
+
print("Passing input as string")
|
49
|
+
if isinstance(data, list):
|
50
|
+
data = pa.array(data) # initialize pyarrow array
|
51
|
+
elif isinstance(data, str):
|
52
|
+
data = pa.array([data])
|
53
|
+
elif isinstance(data, int):
|
54
|
+
data = pa.array([data])
|
55
|
+
elif isinstance(data, float):
|
56
|
+
data = pa.array([data])
|
57
|
+
else:
|
58
|
+
data = pa.array(data) # initialize pyarrow array
|
59
|
+
node.send_output("data", data)
|
60
|
+
|
61
|
+
|
62
|
+
if __name__ == "__main__":
|
63
|
+
main()
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: pyarrow-sender
|
3
|
+
Version: 0.3.6
|
4
|
+
Summary: Dora pyarrow Sender
|
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
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Programming Language :: Python :: 2
|
11
|
+
Classifier: Programming Language :: Python :: 2.7
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
13
|
+
Classifier: Programming Language :: Python :: 3.4
|
14
|
+
Classifier: Programming Language :: Python :: 3.5
|
15
|
+
Classifier: Programming Language :: Python :: 3.6
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
22
|
+
Requires-Dist: dora-rs (>=0.3.6,<0.4.0)
|
23
|
+
Requires-Dist: numpy (<2.0.0)
|
24
|
+
Requires-Dist: pyarrow (>=5.0.0)
|
25
|
+
Project-URL: Documentation, https://github.com/dora-rs/dora/blob/main/node-hub/pyarrow-sender/README.md
|
26
|
+
Description-Content-Type: text/markdown
|
27
|
+
|
28
|
+
# Dora Node for sending arrow data.
|
29
|
+
|
30
|
+
This node send DATA that is specified within the environment variable or from `--data` argument.
|
31
|
+
|
32
|
+
Check example at [examples/pyarrow-test](examples/pyarrow-test)
|
33
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
pyarrow_sender/__init__.py,sha256=Gy4qL4vCeTyA5HR1Yp3ioL4-ClJyW8oi_38CzMuMsBM,358
|
2
|
+
pyarrow_sender/main.py,sha256=VN9T1T-17CoZeRzN_PRoenLwyEUchPTdkOut5KPN2eA,1616
|
3
|
+
pyarrow_sender-0.3.6.dist-info/METADATA,sha256=qPgi5pQyW8P0zfIrbu8_3GL99WNIq-NhjwFC0EFoZhI,1309
|
4
|
+
pyarrow_sender-0.3.6.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
|
5
|
+
pyarrow_sender-0.3.6.dist-info/entry_points.txt,sha256=3AWaBv-7MPtqM0J5l9jo4MTx0xw2MXrGja_ZXEN9wT0,59
|
6
|
+
pyarrow_sender-0.3.6.dist-info/RECORD,,
|