-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathsql_view.py
More file actions
23 lines (21 loc) · 644 Bytes
/
sql_view.py
File metadata and controls
23 lines (21 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class SQLView:
"""
Represents a SQL view in Feldera
"""
def __init__(
self,
name: str,
fields: list[dict],
case_sensitive: bool = False,
materialized: bool = False,
):
self.name = name
self.case_sensitive = case_sensitive
self.materialized = materialized
self.fields: list[dict] = fields
@classmethod
def from_dict(self, view_dict: dict):
tbl = SQLView(name=view_dict["name"], fields=view_dict["fields"])
tbl.case_sensitive = view_dict["case_sensitive"]
tbl.materialized = view_dict["materialized"]
return tbl