@@ -52,8 +52,8 @@ class QueriesCommand(SnowSQLCommand):
52
52
amount : int = 25
53
53
user : str | None = None
54
54
warehouse : str | None = None
55
- start_timestamp_ms : float | None = None
56
- end_timestamp_ms : float | None = None
55
+ start_timestamp_ms : int | None = None
56
+ end_timestamp_ms : int | None = None
57
57
duration : str | None = None
58
58
stmt_type : str | None = None
59
59
status : str | None = None
@@ -81,8 +81,8 @@ def _execute_help(self):
81
81
"datetime in ISO format (for example YYYY-MM-DDTHH:mm:ss.sss)" ,
82
82
"any" ,
83
83
],
84
- ["start" , "timestamp in milliseconds" , "any" ],
85
- ["end" , "timestamp in milliseconds" , "any" ],
84
+ ["start" , "timestamp in milliseconds (integer) " , "any" ],
85
+ ["end" , "timestamp in milliseconds (integer) " , "any" ],
86
86
["type" , "string" , "any" ],
87
87
["duration" , "time in milliseconds" , "any" ],
88
88
["session" , "No arguments" , "any" ],
@@ -147,15 +147,15 @@ def from_args(cls, args: List[str], kwargs: Dict[str, Any]) -> CompileCommandRes
147
147
start_timestamp_ms = kwargs .pop ("start" , None )
148
148
if start_timestamp_ms :
149
149
try :
150
- start_timestamp_ms = float (start_timestamp_ms )
150
+ start_timestamp_ms = int (start_timestamp_ms )
151
151
except ValueError :
152
152
return CompileCommandResult (
153
153
error_message = f"Invalid argument passed to 'start' filter: { start_timestamp_ms } "
154
154
)
155
155
end_timestamp_ms = kwargs .pop ("end" , None )
156
156
if end_timestamp_ms :
157
157
try :
158
- end_timestamp_ms = float (end_timestamp_ms )
158
+ end_timestamp_ms = int (end_timestamp_ms )
159
159
except ValueError :
160
160
return CompileCommandResult (
161
161
error_message = f"Invalid argument passed to 'end' filter: { end_timestamp_ms } "
@@ -169,7 +169,7 @@ def from_args(cls, args: List[str], kwargs: Dict[str, Any]) -> CompileCommandRes
169
169
)
170
170
try :
171
171
seconds = datetime .fromisoformat (start_date ).timestamp ()
172
- start_timestamp_ms = seconds * 1000 # convert to milliseconds
172
+ start_timestamp_ms = int ( seconds * 1000 ) # convert to milliseconds
173
173
except ValueError :
174
174
return CompileCommandResult (
175
175
error_message = f"Invalid date format passed to 'start_date' filter: { start_date } "
@@ -182,7 +182,7 @@ def from_args(cls, args: List[str], kwargs: Dict[str, Any]) -> CompileCommandRes
182
182
)
183
183
try :
184
184
seconds = datetime .fromisoformat (end_date ).timestamp ()
185
- end_timestamp_ms = seconds * 1000 # convert to milliseconds
185
+ end_timestamp_ms = int ( seconds * 1000 ) # convert to milliseconds
186
186
except ValueError :
187
187
return CompileCommandResult (
188
188
error_message = f"Invalid date format passed to 'end_date' filter: { end_date } "
0 commit comments