File tree Expand file tree Collapse file tree
datatorch/api/entity/sources Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 }
2424"""
2525
26+ _UPDATE_SOURCE = """
27+ mutation UpdateSource(
28+ $id: ID!
29+ $type: String!
30+ $data: JSON!
31+ ) {
32+ source: updateSource(
33+ id: $id
34+ type: $type
35+ data: $data
36+ ) {
37+ id
38+ }
39+ }
40+ """
2641
2742class Source (BaseEntity ):
2843
@@ -56,3 +71,16 @@ def create(self, client=None):
5671 )
5772 r_source = results .get ("source" )
5873 self .id = r_source .get ("id" )
74+
75+ def save (self , client = None ):
76+ super ().save (client = client )
77+
78+ assert self .type is not None , "Source must have a type"
79+ self .client .execute (
80+ _UPDATE_SOURCE ,
81+ params = {
82+ "id" : self .id ,
83+ "type" : self .type ,
84+ "data" : self .data (),
85+ },
86+ )
Original file line number Diff line number Diff line change 2424
2525setup (
2626 name = "datatorch" ,
27- version = "0.4.0 " ,
27+ version = "0.4.1 " ,
2828 description = "A CLI and library for interacting with DataTorch" ,
2929 author = "DataTorch" ,
3030 author_email = "support@datatorch.io" ,
You can’t perform that action at this time.
0 commit comments