1
1
from datetime import datetime as _datetime
2
+ from datetime import timedelta as _timedelta
2
3
from datetime import timezone as _timezone
3
4
from typing import Dict , Optional
4
5
@@ -48,12 +49,12 @@ def from_flyte_idl(cls, pb2_object):
48
49
class Primitive (_common .FlyteIdlEntity ):
49
50
def __init__ (
50
51
self ,
51
- integer = None ,
52
- float_value = None ,
53
- string_value = None ,
54
- boolean = None ,
55
- datetime = None ,
56
- duration = None ,
52
+ integer : Optional [ int ] = None ,
53
+ float_value : Optional [ float ] = None ,
54
+ string_value : Optional [ str ] = None ,
55
+ boolean : Optional [ bool ] = None ,
56
+ datetime : Optional [ _datetime ] = None ,
57
+ duration : Optional [ _timedelta ] = None ,
57
58
):
58
59
"""
59
60
This object proxies the primitives supported by the Flyte IDL system. Only one value can be set.
@@ -77,35 +78,35 @@ def __init__(
77
78
self ._duration = duration
78
79
79
80
@property
80
- def integer (self ):
81
+ def integer (self ) -> Optional [ int ] :
81
82
"""
82
83
:rtype: int
83
84
"""
84
85
return self ._integer
85
86
86
87
@property
87
- def float_value (self ):
88
+ def float_value (self ) -> Optional [ float ] :
88
89
"""
89
90
:rtype: float
90
91
"""
91
92
return self ._float_value
92
93
93
94
@property
94
- def string_value (self ):
95
+ def string_value (self ) -> Optional [ str ] :
95
96
"""
96
97
:rtype: Text
97
98
"""
98
99
return self ._string_value
99
100
100
101
@property
101
- def boolean (self ):
102
+ def boolean (self ) -> Optional [ bool ] :
102
103
"""
103
104
:rtype: bool
104
105
"""
105
106
return self ._boolean
106
107
107
108
@property
108
- def datetime (self ):
109
+ def datetime (self ) -> Optional [ _datetime ] :
109
110
"""
110
111
:rtype: datetime.datetime
111
112
"""
@@ -114,7 +115,7 @@ def datetime(self):
114
115
return self ._datetime .replace (tzinfo = _timezone .utc )
115
116
116
117
@property
117
- def duration (self ):
118
+ def duration (self ) -> Optional [ _timedelta ] :
118
119
"""
119
120
:rtype: datetime.timedelta
120
121
"""
@@ -703,15 +704,15 @@ def from_flyte_idl(cls, pb2_object):
703
704
class Scalar (_common .FlyteIdlEntity ):
704
705
def __init__ (
705
706
self ,
706
- primitive : Primitive = None ,
707
- blob : Blob = None ,
708
- binary : Binary = None ,
709
- schema : Schema = None ,
710
- union : Union = None ,
711
- none_type : Void = None ,
712
- error : Error = None ,
713
- generic : Struct = None ,
714
- structured_dataset : StructuredDataset = None ,
707
+ primitive : Optional [ Primitive ] = None ,
708
+ blob : Optional [ Blob ] = None ,
709
+ binary : Optional [ Binary ] = None ,
710
+ schema : Optional [ Schema ] = None ,
711
+ union : Optional [ Union ] = None ,
712
+ none_type : Optional [ Void ] = None ,
713
+ error : Optional [ Error ] = None ,
714
+ generic : Optional [ Struct ] = None ,
715
+ structured_dataset : Optional [ StructuredDataset ] = None ,
715
716
):
716
717
"""
717
718
Scalar wrapper around Flyte types. Only one can be specified.
0 commit comments