Skip to content

Commit

Permalink
Merge branch 'main' into add-cri-test
Browse files Browse the repository at this point in the history
  • Loading branch information
anson627 authored Dec 27, 2024
2 parents 84e16fe + ff8ea16 commit 0aa08ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions modules/python/kusto/generate_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ def infer_type(value):
pass

# Check if it's a datetime
try:
datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ')
return "datetime"
except ValueError:
pass
for fmt in ('%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%M:%S.%f'):
try:
datetime.strptime(value, fmt)
return "datetime"
except ValueError:
pass

# If none of the above, take it as string
return "string"
Expand Down
2 changes: 2 additions & 0 deletions modules/python/tests/test_generate_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def test_infer_dynamic(self):

def test_infer_datetime(self):
self.assertEqual(infer_type('2022-01-01T12:00:00Z'), 'datetime')
self.assertEqual(infer_type('2024-12-26T12:14:50.637517'), 'datetime')
self.assertNotEqual(infer_type('2024-12-26T15:02:17.681161609Z'), 'datetime')
self.assertNotEqual(infer_type('abc'), 'datetime')
self.assertNotEqual(infer_type('123'), 'datetime')
self.assertNotEqual(infer_type(123456), 'datetime')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schedules:
displayName: "10:00 AM & PM Daily"
branches:
include:
- sanprabhu/40kpods
- main
always: true

variables:
Expand Down

0 comments on commit 0aa08ed

Please sign in to comment.