Skip to content

Commit bcc886f

Browse files
samronsinmhham
andauthored
Be extra careful with "time" key in MLTaskSetting
Co-authored-by: Mehdi Hamoumi <[email protected]>
1 parent a555337 commit bcc886f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dataikuapi/dss/ml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def get_time_ordering_variable(self):
175175
:return: the name of the variable
176176
:rtype: str
177177
"""
178-
if self.mltask_settings.get('time', None) and self.mltask_settings['time']['enabled']:
178+
if 'time' in self.mltask_settings and self.mltask_settings['time']['enabled']:
179179
return self.mltask_settings['time']['timeVariable']
180180
else:
181181
warnings.warn("Time-based ordering is disabled in the current MLTask")
@@ -185,7 +185,7 @@ def is_time_ordering_ascending(self):
185185
:return: True if the ordering is set to be ascending with respect to the time-ordering variable
186186
:rtype: bool
187187
"""
188-
if self.mltask_settings.get('time', None) and self.mltask_settings['time']['enabled']:
188+
if 'time' in self.mltask_settings and self.mltask_settings['time']['enabled']:
189189
return self.mltask_settings['time']['ascending']
190190
else:
191191
warnings.warn("Time-based ordering is disabled in the current MLTask")

0 commit comments

Comments
 (0)