File tree 2 files changed +7
-4
lines changed
metadata_service/tests/unit_tests
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 25
25
(["metaflow_version:2.12.24+inconsequential+trailing-string" ], True ),
26
26
(["metaflow_version:2.12.24.break" ], True ),
27
27
(["metaflow_version:3" ], True ),
28
+ (["metaflow_version:custom-1" ], True ),
28
29
]
29
30
30
31
Original file line number Diff line number Diff line change @@ -150,18 +150,20 @@ def has_heartbeat_capable_version_tag(system_tags):
150
150
"""Check client version tag whether it is known to support heartbeats or not"""
151
151
try :
152
152
# only parse for the major.minor.patch version and disregard any trailing bits that might cause issues with comparison.
153
- version_tag = [tag for tag in system_tags if tag .startswith ('metaflow_version:' )][0 ]
153
+ version_tags = [tag for tag in system_tags if tag .startswith ('metaflow_version:' )]
154
+ if not version_tags :
155
+ return False
154
156
# match versions: major | major.minor | major.minor.patch
155
- ver_string = re .match (r"(0|\d+)(\.(0|\d+))*" , version_tag [len ("metaflow_version:" ):])[0 ]
156
- print (ver_string )
157
+ ver_string = re .match (r"(0|\d+)(\.(0|\d+))*" , version_tags [0 ].lstrip ("metaflow_version:" ))[0 ]
157
158
version = parse (ver_string )
158
159
159
160
if version >= Version ("1" ) and version < Version ("2" ):
160
161
return version >= Version ("1.14.0" )
161
162
162
163
return version >= Version ("2.2.12" )
163
164
except Exception :
164
- return False
165
+ # Treat non-standard versions as heartbeat-enabled by default
166
+ return True
165
167
166
168
# Database configuration helper
167
169
# Prioritizes DSN string over individual connection arguments (host,user,...)
You can’t perform that action at this time.
0 commit comments