cs-models 0.0.680__py3-none-any.whl → 0.0.682__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.
Potentially problematic release.
This version of cs-models might be problematic. Click here for more details.
- cs_models/resources/AssistantUserQuery/models.py +3 -3
- cs_models/resources/AssistantUserQuery/schemas.py +40 -2
- cs_models/resources/WorkbookBlock/models.py +2 -2
- cs_models/resources/WorkbookBlock/schemas.py +2 -2
- {cs_models-0.0.680.dist-info → cs_models-0.0.682.dist-info}/METADATA +1 -1
- {cs_models-0.0.680.dist-info → cs_models-0.0.682.dist-info}/RECORD +8 -8
- {cs_models-0.0.680.dist-info → cs_models-0.0.682.dist-info}/WHEEL +0 -0
- {cs_models-0.0.680.dist-info → cs_models-0.0.682.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import enum
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
|
|
4
|
-
from sqlalchemy import Column, DateTime, Enum, ForeignKey, Integer, String
|
|
4
|
+
from sqlalchemy import Column, DateTime, Enum, ForeignKey, Integer, String, Text
|
|
5
5
|
from sqlalchemy.orm import relationship
|
|
6
6
|
|
|
7
7
|
from ...database import Base
|
|
@@ -29,8 +29,8 @@ class AssistantUserQueryModel(Base):
|
|
|
29
29
|
nullable=False,
|
|
30
30
|
)
|
|
31
31
|
filter = Column(
|
|
32
|
-
|
|
33
|
-
nullable=
|
|
32
|
+
Text,
|
|
33
|
+
nullable=True,
|
|
34
34
|
)
|
|
35
35
|
type = Column(
|
|
36
36
|
String,
|
|
@@ -1,16 +1,54 @@
|
|
|
1
|
+
import json
|
|
1
2
|
from marshmallow import Schema, fields
|
|
2
|
-
|
|
3
3
|
from .models import AssistantUserQueryStatusEnum
|
|
4
4
|
from ..AssistantCommand.schemas import (
|
|
5
5
|
AssistantCommandResourceSchema,
|
|
6
6
|
)
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
class AssistantUserQueryFilterField(fields.Field):
|
|
10
|
+
"""Field that stores result for the Assistant command."""
|
|
11
|
+
|
|
12
|
+
def _serialize(self, value, attr, obj, **kwargs):
|
|
13
|
+
"""
|
|
14
|
+
In the DB, the `result` field is a text field. We persist
|
|
15
|
+
data by performing the following:
|
|
16
|
+
|
|
17
|
+
AssistantCommandModel(
|
|
18
|
+
...
|
|
19
|
+
result=json.dumps({...}),
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
So here we need to perform the inverse operation (i.e `json.loads(..)`)
|
|
23
|
+
"""
|
|
24
|
+
if value is None:
|
|
25
|
+
return None
|
|
26
|
+
return json.loads(value)
|
|
27
|
+
|
|
28
|
+
def _deserialize(self, value, attr, data, **kwargs):
|
|
29
|
+
"""
|
|
30
|
+
In the DB, the `result` field is a text field. We persist
|
|
31
|
+
data by performing the following:
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
AssistantCommandModel(
|
|
36
|
+
***AssistantCommandResourceSchema().load({
|
|
37
|
+
...
|
|
38
|
+
"result": [{"some_key": 1}, {"some_key": 2}],
|
|
39
|
+
}),
|
|
40
|
+
)
|
|
41
|
+
"""
|
|
42
|
+
if value is None:
|
|
43
|
+
return None
|
|
44
|
+
return json.dumps(value)
|
|
45
|
+
|
|
46
|
+
|
|
9
47
|
class AssistantUserQueryResourceSchema(Schema):
|
|
10
48
|
id = fields.Integer(dump_only=True)
|
|
11
49
|
session_id = fields.Integer(required=True)
|
|
12
50
|
value = fields.String(required=True)
|
|
13
|
-
filter =
|
|
51
|
+
filter = AssistantUserQueryFilterField(allow_none=True)
|
|
14
52
|
type = fields.String(required=True)
|
|
15
53
|
status = fields.Enum(AssistantUserQueryStatusEnum, required=True, by_value=True)
|
|
16
54
|
commands = fields.Nested(
|
|
@@ -17,8 +17,8 @@ class WorkbookBlockModel(Base):
|
|
|
17
17
|
nullable=False,
|
|
18
18
|
)
|
|
19
19
|
sequence_number = Column(Integer, nullable=False)
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
type = Column(String(50), nullable=False)
|
|
21
|
+
data = Column(Text, nullable=True)
|
|
22
22
|
is_deleted = Column(Boolean, nullable=True)
|
|
23
23
|
created_at = Column(DateTime, nullable=False, default=lambda: datetime.utcnow())
|
|
24
24
|
updated_at = Column(
|
|
@@ -50,8 +50,8 @@ class WorkbookBlockResourceSchema(Schema):
|
|
|
50
50
|
id = fields.Integer(dump_only=True)
|
|
51
51
|
workbook_id = fields.Integer(required=True)
|
|
52
52
|
sequence_number = fields.Integer(required=True)
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
type = fields.String(required=True)
|
|
54
|
+
data = WorkbookBlockDataField(required=True, allow_none=True)
|
|
55
55
|
comments = fields.Nested(
|
|
56
56
|
WorkbookBlockCommentResourceSchema(exclude=("block_id",)),
|
|
57
57
|
many=True,
|
|
@@ -59,8 +59,8 @@ cs_models/resources/AssistantSession/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
|
59
59
|
cs_models/resources/AssistantSession/models.py,sha256=_aWsZ71HFytf0ufekL_dGGECYKDPPzlRSPXAv9dR0rY,1417
|
|
60
60
|
cs_models/resources/AssistantSession/schemas.py,sha256=v4orSJwiNDzmcjdUHoW9CZpkS7pxsUwEdQDUJpOqwg4,781
|
|
61
61
|
cs_models/resources/AssistantUserQuery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
-
cs_models/resources/AssistantUserQuery/models.py,sha256=
|
|
63
|
-
cs_models/resources/AssistantUserQuery/schemas.py,sha256=
|
|
62
|
+
cs_models/resources/AssistantUserQuery/models.py,sha256=Je_-aQ702dWxQSTH398dspF8_glRCHtSA6_LdWLW410,1823
|
|
63
|
+
cs_models/resources/AssistantUserQuery/schemas.py,sha256=ju2-XM9xdXCNwcFy0YDzJ0dH0Nj2BxTRZPqnItFZMVo,1819
|
|
64
64
|
cs_models/resources/B3CRSS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
65
|
cs_models/resources/B3CRSS/models.py,sha256=rl538IgpQSzZu0FzpfxbDDCRWGkAGTpqcw9or5tMOg8,629
|
|
66
66
|
cs_models/resources/B3CRSS/schemas.py,sha256=mArXYiVl15oEFaz9RLQ6WN68ueI0ec83NeLrNnP-sMM,346
|
|
@@ -1087,8 +1087,8 @@ cs_models/resources/Workbook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
1087
1087
|
cs_models/resources/Workbook/models.py,sha256=4p2R8WCYYX0FOSXG0b2YhmuzKHTxYY4WZVi9X7e9GKQ,1003
|
|
1088
1088
|
cs_models/resources/Workbook/schemas.py,sha256=xcNoPzHK6ER06XA3fAvX3x7VtX47aBP0vrIqiJvUVKw,688
|
|
1089
1089
|
cs_models/resources/WorkbookBlock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1090
|
-
cs_models/resources/WorkbookBlock/models.py,sha256=
|
|
1091
|
-
cs_models/resources/WorkbookBlock/schemas.py,sha256=
|
|
1090
|
+
cs_models/resources/WorkbookBlock/models.py,sha256=hYZkSFR5p6nVMUbb6ZQxvXvB6XMPlgEDliBx_k0HZ40,1659
|
|
1091
|
+
cs_models/resources/WorkbookBlock/schemas.py,sha256=lRon0US-VHMOGypaiUSZsskgFpjNEtmFEk9nFU7DLnI,1847
|
|
1092
1092
|
cs_models/resources/WorkbookBlockComment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1093
1093
|
cs_models/resources/WorkbookBlockComment/models.py,sha256=t1dLdweoPOzld1uBqrGJ3rrr66UkMwdiplNZEA1WtPU,1251
|
|
1094
1094
|
cs_models/resources/WorkbookBlockComment/schemas.py,sha256=9UI_mTuPBYBk5qKUC2u0oR_clHA9XZ-bh5hhr24E-vs,563
|
|
@@ -1138,7 +1138,7 @@ cs_models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
1138
1138
|
cs_models/utils/alchemy.py,sha256=fhINGFn41owJ2DLXQKXAAtLqeZ1BRzD_qU0wPK_bsGQ,1598
|
|
1139
1139
|
cs_models/utils/utils.py,sha256=bY623DuzycfPQiaOQT2AxfANeWfwr5w76dBuQ813-ns,3664
|
|
1140
1140
|
cs_models/utils/profiling/__init__.py,sha256=N-73vb0M92C975fxgXyBCBjCPELl8Oh21ZY_-tzDnns,569
|
|
1141
|
-
cs_models-0.0.
|
|
1142
|
-
cs_models-0.0.
|
|
1143
|
-
cs_models-0.0.
|
|
1144
|
-
cs_models-0.0.
|
|
1141
|
+
cs_models-0.0.682.dist-info/METADATA,sha256=6jOpW7GRHCi8l1M3fvGiv8ReFxaSlJ_3_Pju6m9ReMc,792
|
|
1142
|
+
cs_models-0.0.682.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
1143
|
+
cs_models-0.0.682.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
|
|
1144
|
+
cs_models-0.0.682.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|