pyarrow-sender 0.3.8__py3-none-any.whl → 0.3.9__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.
@@ -5,7 +5,7 @@ readme_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.m
5
5
 
6
6
  # Read the content of the README file
7
7
  try:
8
- with open(readme_path, "r", encoding="utf-8") as f:
8
+ with open(readme_path, encoding="utf-8") as f:
9
9
  __doc__ = f.read()
10
10
  except FileNotFoundError:
11
11
  __doc__ = "README file not found."
pyarrow_sender/main.py CHANGED
@@ -1,16 +1,14 @@
1
1
  import argparse
2
- import os
3
2
  import ast
3
+ import os
4
4
 
5
5
  import pyarrow as pa
6
-
7
6
  from dora import Node
8
7
 
9
8
  RUNNER_CI = True if os.getenv("CI") == "true" else False
10
9
 
11
10
 
12
11
  def main():
13
-
14
12
  # Handle dynamic nodes, ask for the name of the node in the dataflow, and the same values as the ENV variables.
15
13
  parser = argparse.ArgumentParser(description="Simple arrow sender")
16
14
 
@@ -34,29 +32,24 @@ def main():
34
32
  data = os.getenv("DATA", args.data)
35
33
 
36
34
  node = Node(
37
- args.name
35
+ args.name,
38
36
  ) # provide the name to connect to the dataflow if dynamic node
39
37
 
40
38
  if data is None:
41
39
  raise ValueError(
42
- "No data provided. Please specify `DATA` environment argument or as `--data` argument"
40
+ "No data provided. Please specify `DATA` environment argument or as `--data` argument",
43
41
  )
42
+ try:
43
+ data = ast.literal_eval(data)
44
+ except ValueError:
45
+ print("Passing input as string")
46
+ if isinstance(data, list):
47
+ data = pa.array(data) # initialize pyarrow array
48
+ elif isinstance(data, str) or isinstance(data, int) or isinstance(data, float):
49
+ data = pa.array([data])
44
50
  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)
51
+ data = pa.array(data) # initialize pyarrow array
52
+ node.send_output("data", data)
60
53
 
61
54
 
62
55
  if __name__ == "__main__":
@@ -0,0 +1,17 @@
1
+ Metadata-Version: 2.2
2
+ Name: pyarrow-sender
3
+ Version: 0.3.9
4
+ Summary: Dora pyarrow Sender
5
+ Author-email: Haixuan Xavier Tao <tao.xavier@outlook.com>, Enzo Le Van <dev@enzo-le-van.fr>
6
+ License: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: dora-rs>=0.3.6
10
+ Requires-Dist: numpy<2.0.0
11
+ Requires-Dist: pyarrow>=5.0.0
12
+
13
+ # Dora Node for sending arrow data.
14
+
15
+ This node send DATA that is specified within the environment variable or from `--data` argument.
16
+
17
+ Check example at [examples/pyarrow-test](examples/pyarrow-test)
@@ -0,0 +1,7 @@
1
+ pyarrow_sender/__init__.py,sha256=HuSK3dnyI9Pb5QAuaKFwQQ3J5SIZnLcKHPJO0norGzc,353
2
+ pyarrow_sender/main.py,sha256=UP2VQztlbGQOaUhFdbVRT7o2c0Nba9O4j01tShc3qxY,1468
3
+ pyarrow_sender-0.3.9.dist-info/METADATA,sha256=D21v2fSAFbkc8ftbidWrpLrscSu9Favuby4VP-V36aM,542
4
+ pyarrow_sender-0.3.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
+ pyarrow_sender-0.3.9.dist-info/entry_points.txt,sha256=shagIvIXl6hEDDqWQPUtp3k-hl7q5dQV_0ChMo9-a7s,60
6
+ pyarrow_sender-0.3.9.dist-info/top_level.txt,sha256=oiFNG2ycuyw6e36z47mIJ6x21yl9pnzr8PQVj0GeCAI,15
7
+ pyarrow_sender-0.3.9.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pyarrow-sender = pyarrow_sender.main:main
@@ -0,0 +1 @@
1
+ pyarrow_sender
@@ -1,30 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pyarrow-sender
3
- Version: 0.3.8
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
- 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-sender/README.md
23
- Description-Content-Type: text/markdown
24
-
25
- # Dora Node for sending arrow data.
26
-
27
- This node send DATA that is specified within the environment variable or from `--data` argument.
28
-
29
- Check example at [examples/pyarrow-test](examples/pyarrow-test)
30
-
@@ -1,6 +0,0 @@
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.8.dist-info/METADATA,sha256=hkjYKi5zxkTP3_WYQb8_DJ-uT6B6YI84IZWW6qHXqgU,1140
4
- pyarrow_sender-0.3.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
5
- pyarrow_sender-0.3.8.dist-info/entry_points.txt,sha256=3AWaBv-7MPtqM0J5l9jo4MTx0xw2MXrGja_ZXEN9wT0,59
6
- pyarrow_sender-0.3.8.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- pyarrow-sender=pyarrow_sender.main:main
3
-