feldera 0.34.0__tar.gz → 0.35.0__tar.gz
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.
Potentially problematic release.
This version of feldera might be problematic. Click here for more details.
- {feldera-0.34.0 → feldera-0.35.0}/PKG-INFO +1 -1
- {feldera-0.34.0 → feldera-0.35.0}/feldera/_helpers.py +13 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/_httprequests.py +2 -1
- {feldera-0.34.0 → feldera-0.35.0}/feldera.egg-info/PKG-INFO +1 -1
- {feldera-0.34.0 → feldera-0.35.0}/pyproject.toml +1 -1
- {feldera-0.34.0 → feldera-0.35.0}/tests/test_pipeline.py +8 -5
- {feldera-0.34.0 → feldera-0.35.0}/tests/test_pipeline_builder.py +26 -0
- {feldera-0.34.0 → feldera-0.35.0}/README.md +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/__init__.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/_callback_runner.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/enums.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/output_handler.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/pipeline.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/pipeline_builder.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/__init__.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/config.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/errors.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/feldera_client.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/pipeline.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/sql_table.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/rest/sql_view.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera/runtime_config.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera.egg-info/SOURCES.txt +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera.egg-info/dependency_links.txt +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera.egg-info/requires.txt +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/feldera.egg-info/top_level.txt +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/setup.cfg +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/tests/test_udf.py +0 -0
- {feldera-0.34.0 → feldera-0.35.0}/tests/test_variant.py +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
|
|
1
3
|
import pandas as pd
|
|
2
4
|
from decimal import Decimal
|
|
3
5
|
|
|
@@ -8,6 +10,8 @@ def sql_type_to_pandas_type(sql_type: str):
|
|
|
8
10
|
"""
|
|
9
11
|
|
|
10
12
|
match sql_type.upper():
|
|
13
|
+
case "UUID":
|
|
14
|
+
return None
|
|
11
15
|
case "BOOLEAN":
|
|
12
16
|
return "boolean"
|
|
13
17
|
case "TINYINT":
|
|
@@ -64,6 +68,7 @@ def dataframe_from_response(buffer: list[list[dict]], schema: dict):
|
|
|
64
68
|
pd_schema = {}
|
|
65
69
|
|
|
66
70
|
decimal_col = []
|
|
71
|
+
uuid_col = []
|
|
67
72
|
|
|
68
73
|
for column in schema["fields"]:
|
|
69
74
|
column_name = column["name"]
|
|
@@ -72,6 +77,8 @@ def dataframe_from_response(buffer: list[list[dict]], schema: dict):
|
|
|
72
77
|
column_type = column["columntype"]["type"]
|
|
73
78
|
if column_type == "DECIMAL":
|
|
74
79
|
decimal_col.append(column_name)
|
|
80
|
+
elif column_type == "UUID":
|
|
81
|
+
uuid_col.append(column_name)
|
|
75
82
|
|
|
76
83
|
pd_schema[column_name] = sql_type_to_pandas_type(column_type)
|
|
77
84
|
|
|
@@ -89,6 +96,12 @@ def dataframe_from_response(buffer: list[list[dict]], schema: dict):
|
|
|
89
96
|
if datum[col] is not None:
|
|
90
97
|
datum[col] = Decimal(datum[col])
|
|
91
98
|
|
|
99
|
+
if len(uuid_col) != 0:
|
|
100
|
+
for datum in data:
|
|
101
|
+
for col in uuid_col:
|
|
102
|
+
if datum[col] is not None:
|
|
103
|
+
datum[col] = uuid.UUID(datum[col])
|
|
104
|
+
|
|
92
105
|
df = pd.DataFrame(data)
|
|
93
106
|
df = df.astype(pd_schema)
|
|
94
107
|
|
|
@@ -14,7 +14,8 @@ from typing import Callable, Optional, Any, Union, Mapping, Sequence, List
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def json_serialize(body: Any) -> str:
|
|
17
|
-
|
|
17
|
+
# serialize as string if this object cannot be serialized (e.g. UUID)
|
|
18
|
+
return json.dumps(body, default=str) if body else "" if body == "" else "null"
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class HttpRequests:
|
|
@@ -17,12 +17,15 @@ class TestPipeline(unittest.TestCase):
|
|
|
17
17
|
for pipeline in pipelines:
|
|
18
18
|
TEST_CLIENT.delete_pipeline(pipeline.name)
|
|
19
19
|
|
|
20
|
-
def test_create_pipeline(
|
|
20
|
+
def test_create_pipeline(
|
|
21
|
+
self, name: str = "blah", delete=False, runtime_config: dict = {}
|
|
22
|
+
):
|
|
23
|
+
self.test_delete_all_pipelines()
|
|
21
24
|
sql = """
|
|
22
25
|
CREATE TABLE tbl(id INT) WITH ('append_only' = 'true');
|
|
23
26
|
CREATE VIEW V AS SELECT * FROM tbl;
|
|
24
27
|
"""
|
|
25
|
-
pipeline = Pipeline(name, sql, "", "", {},
|
|
28
|
+
pipeline = Pipeline(name, sql, "", "", {}, runtime_config)
|
|
26
29
|
pipeline = TEST_CLIENT.create_pipeline(pipeline)
|
|
27
30
|
|
|
28
31
|
if delete:
|
|
@@ -84,12 +87,12 @@ class TestPipeline(unittest.TestCase):
|
|
|
84
87
|
|
|
85
88
|
def test_get_pipeline_config(self):
|
|
86
89
|
name = str(uuid.uuid4())
|
|
87
|
-
self.test_create_pipeline(name, False)
|
|
90
|
+
self.test_create_pipeline(name, False, {"workers": 2, "storage": False})
|
|
88
91
|
config = TEST_CLIENT.get_runtime_config(name)
|
|
89
92
|
|
|
90
93
|
assert config is not None
|
|
91
|
-
assert config.get("workers")
|
|
92
|
-
assert config.get("storage")
|
|
94
|
+
assert config.get("workers") == 2
|
|
95
|
+
assert not config.get("storage")
|
|
93
96
|
|
|
94
97
|
TEST_CLIENT.delete_pipeline(name)
|
|
95
98
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import time
|
|
3
3
|
import unittest
|
|
4
|
+
import uuid
|
|
5
|
+
|
|
4
6
|
import pandas as pd
|
|
5
7
|
from kafka import KafkaProducer, KafkaConsumer
|
|
6
8
|
from kafka.admin import KafkaAdminClient, NewTopic
|
|
@@ -1057,6 +1059,30 @@ Code snippet:
|
|
|
1057
1059
|
pipeline.shutdown()
|
|
1058
1060
|
pipeline.delete()
|
|
1059
1061
|
|
|
1062
|
+
def test_uuid(self):
|
|
1063
|
+
name = "test_uuid"
|
|
1064
|
+
sql = """
|
|
1065
|
+
CREATE TABLE t0(c0 UUID);
|
|
1066
|
+
CREATE MATERIALIZED VIEW v0 AS SELECT c0 FROM t0;
|
|
1067
|
+
"""
|
|
1068
|
+
|
|
1069
|
+
pipeline = PipelineBuilder(TEST_CLIENT, name, sql=sql).create_or_replace()
|
|
1070
|
+
out = pipeline.listen("v0")
|
|
1071
|
+
pipeline.start()
|
|
1072
|
+
|
|
1073
|
+
data = [{"c0": uuid.uuid4()}]
|
|
1074
|
+
pipeline.input_json("t0", data)
|
|
1075
|
+
|
|
1076
|
+
for datum in data:
|
|
1077
|
+
datum.update({"insert_delete": 1})
|
|
1078
|
+
|
|
1079
|
+
pipeline.wait_for_completion(True)
|
|
1080
|
+
|
|
1081
|
+
got = out.to_dict()
|
|
1082
|
+
pipeline.shutdown()
|
|
1083
|
+
|
|
1084
|
+
assert got == data
|
|
1085
|
+
|
|
1060
1086
|
|
|
1061
1087
|
if __name__ == "__main__":
|
|
1062
1088
|
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|