Skip to content

Commit cf7aa10

Browse files
author
amesar
committed
Issue #62: added 'package' attribute to 'system' stanza in JSON export file format
1 parent e06b6dd commit cf7aa10

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

mlflow_export_import/common/io_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from mlflow_export_import.common.timestamp_utils import ts_now_seconds, ts_now_fmt_utc
55
from mlflow_export_import.common import filesystem as _filesystem
66
from mlflow_export_import.common.source_tags import ExportFields
7+
from mlflow_export_import.common.pkg_version import get_version #
78

89

910
def _mk_system_attr(script):
@@ -14,6 +15,7 @@ def _mk_system_attr(script):
1415
import platform
1516
return {
1617
ExportFields.SYSTEM: {
18+
"package_version": get_version(),
1719
"script": os.path.basename(script),
1820
"export_time": ts_now_seconds,
1921
"_export_time": ts_now_fmt_utc,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
from importlib.metadata import version
3+
4+
pkg = "mlflow_export_import"
5+
6+
def get_version():
7+
return version(pkg)

0 commit comments

Comments
 (0)