We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 618541a commit 083b9ffCopy full SHA for 083b9ff
cloudquery/sdk/transformers/openapi.py
@@ -0,0 +1,20 @@
1
+from typing import Dict, List
2
+import pyarrow as pa
3
+from cloudquery.sdk.schema import Column
4
+
5
+def oapi_type_to_arrow_type(field) -> pa.DataType:
6
+ oapi_type = field.get("type")
7
+ if oapi_type == "string":
8
+ return pa.string()
9
+ elif oapi_type == "number":
10
+ return pa.int64()
11
+ elif oapi_type == "boolean":
12
+ return pa.bool_()
13
+ else:
14
15
16
+def oapi_properties_to_columns(properties: Dict) -> List[Column]:
17
+ columns = []
18
+ for key, value in properties.items():
19
+ columns.append(Column(name=key, type=value, description=value.get("description")))
20
+ return columns
0 commit comments