-
Notifications
You must be signed in to change notification settings - Fork 453
/
row.py
33 lines (25 loc) · 907 Bytes
/
row.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.
from enum import Enum
from typing import Any
from materialize.data_ingest.field import Field
class Operation(Enum):
INSERT = 1
UPSERT = 2
DELETE = 3
class Row:
fields: list[Field]
values: list[Any]
operation: Operation
def __init__(self, fields: list[Field], values: list[Any], operation: Operation):
self.fields = fields
self.values = values
self.operation = operation
def __repr__(self) -> str:
return f"Row({self.fields}, {self.values}, {self.operation})"