Skip to content

Commit

Permalink
fix: enable backwards compatibility foe old namespace (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamilton723 committed Nov 4, 2021
1 parent 5429d80 commit ba41290
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/src/main/python/mmlspark/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import sys
import warnings
warnings.warn("The mmlspark namespace has been deprecated. Please change import statements to import from synapse.ml")
import synapse.ml
sys.modules['mmlspark'] = synapse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ object CodeGen {
if (!conf.pySrcDir.exists()) {
conf.pySrcDir.mkdir()
}
val extraPackage = if (conf.name.endsWith("core")){" + [\"mmlspark\"]"}else{""}
writeFile(join(conf.pySrcDir, "setup.py"),
s"""
|# Copyright (C) Microsoft Corporation. All rights reserved.
Expand All @@ -153,7 +154,7 @@ object CodeGen {
| long_description="SynapseML contains Microsoft's open source "
| + "contributions to the Apache Spark ecosystem",
| license="MIT",
| packages=find_namespace_packages(include=['synapse.ml.*']),
| packages=find_namespace_packages(include=['synapse.ml.*']) ${extraPackage},
| url="https://github.com/Microsoft/SynapseML",
| author="Microsoft",
| author_email="mmlspark-support@microsoft.com",
Expand Down

0 comments on commit ba41290

Please sign in to comment.