Python 2 deprecation / migration to Python 3¶
Warning
DataRobot has deprecated and removed Python 2, in its entirety, from the platform. For SaaS users, all projects built with Python 2 are disabled but still available in the project management center, where they can be copied and rebuilt with Python 3. For self-managed users, Python 2 is disabled as of release 9.0, as described here.
Part of the deprecation process includes migrating all user projects to Python 3. Upgrading to Python 3 will improve platform reliability and security. Additionally it enables the DataRobot development team to modernize the codebase and deliver more innovative features faster and with better quality.
Pay careful attention to the guidance below as it will likely require actions from you and other members within your organization. If at any point you have questions, reach out to your DataRobot representative with any questions and they will gladly assist in any way possible to make the migration a smooth experience.
This guide explains the deprecation process and how to migrate to Python 3.
Users impacted¶
The Python changes apply to the following users:
- All managed AI Platform (SaaS) users.
- All Self-Managed AI Platform users (except net-new installations starting with Release 7.1 or later. See the FAQ for more details).
Products impacted¶
- AutoML
- Time series (AutoTS)
- MLOps
Actions required and important dates¶
As milestones approach, specific dates will be communicated, both via email communications and within this documentation. View the information for your installation in the appropriate tab.
Consider the dates below:
March 2022
- Starting March 7th, 2022, new projects created on the managed AI Platform (SaaS) will use Python 3 by default for model building and predictions.
- Existing projects and models created using Python 2 (created before March 7, 2022) will continue to work as expected.
- Deployments can start using models from Python 3 projects. Deployments are not tied to a specific Python version, only the underlying models are.
April 2022
- Existing projects and models using Python 2 will start displaying a deprecation notice in the UI as well in the API response between April 15-22, 2022. To reiterate, these projects and models will continue to work as expected while in the deprecated state, however, this is a good time to start planning and executing the migration steps using the guide below.
- It is highly recommended that you compute insights and generate compliance documentation you will require for auditing on these projects prior to project disablement (the milestone below). All data computed within the project will be retained in a read-only state for long term reference.
- Identify your active and important projects that will be impacted with deprecation and make a plan to migrate them by July 2022.
Note
If a formal model audit process is required in your organization, starting this process as soon as possible to avoid future disruptions to any impacted production workloads is strongly recommended.
July 2022
- Deprecated projects will transition to a “disabled” state and will be placed in read-only mode between July 25-31, 2022.
- Duplication of projects and downloading artifacts such as Scoring Code, models, model packages, and insights charts will still remain enabled. More details are available in the Deprecated and disabled functionality section.
- Existing deployments and predictions will continue to operate (uninterrupted) on Python 2 model deployments within MLOps and Prediction Servers, however, no new deployments can be made with Python 2 models. Migrate your Python 2 model deployments before October 2022 using the guide below.
- Existing or new deployments and predictions on Python 3 models will not experience any impact or limitations.
October 2022
- Python 2 projects will remain in “disabled” state indefinitely. Duplication of projects and additional capabilities will still be supported, as mentioned in the Deprecated and disabled functionality section.
- Python 2 projects and models will no longer be supported. All project data will be retained in a read-only state. You must replace all critical Python 2 projects and all MLOps model deployments with eligible Python 3 models before October 25, 2022.
Schedule:
Timeline | Projects | Deployments | Action Required |
---|---|---|---|
March 7, 2022 | Newly created projects and models in these projects use Python 3 by default. | No impact on existing Python 2 model deployments. Existing or new deployments may use Python 2 or Python 3 models (Python 3 preferable). |
None |
April 15-22, 2022 | Projects using Python 2 to be deprecated. No functional impact. | No impact on existing Python 2 model deployments. Existing or new deployments may use Python 2 or Python 3 models (Python 3 preferable). |
Migrate necessary Python 2 projects and deployments to Python 3. |
July 25-31, 2022 | Projects using Python 2 to be disabled and converted to read-only mode. | No impact on existing Python 2 model deployments. New deployments will not allow Python 2 models (Python 3 models only). |
Migrate necessary Python 2 deployments to Python 3. |
October 25, 2022 | Projects using Python 2 remain in disabled and read-only mode indefinitely. | Python 2 model deployments to be disabled. | Complete migration in advance of this date. |
Consider the dates below:
Release 8.0 upgrades, starting March 2022
- Identify critical projects that will be impacted and make a plan to migrate them.
Note
If a formal model audit process is required, starting this process as soon as possible to avoid future disruptions to any impacted production workloads is strongly recommended.
- The Python Version field is now added to User Activity Monitor reports for App Usage and Predictions Usage in the UI, API, and exported CSV data. This feature is available from DataRobot release 8.0.3 onwards.
- New projects created in Release 8.x will start using Python 3 by default for model building and predictions.
- Existing projects and models created using Python 2 will continue to work as expected.
- Existing projects and models using Python 2 will begin displaying a deprecation notice in the UI as well in the API response. To reiterate, these projects and models will continue to work as expected while in the deprecated state, however, it is best to start planning and executing the migration steps using the guide below.
Prior to Release 9.0 upgrades, March 2023
- Python 2 projects and models will no longer be supported in release 9.x. All project data will be retained in a read-only state. Before upgrading to release 9.x, ensure that all critical Python 2 projects and models are migrated to Python 3 and that any Python 2-based MLOps model deployments have been replaced with eligible Python 3 models.
- Python 2 projects and models created prior to 9.x releases will be disabled once you upgrade to release 9.x. The projects will transition to read-only and new computations will be disabled.
- You are encouraged to compute insights and generate any compliance documentation for auditing purposes on these projects prior to the 9.0 upgrade when these projects will be disabled. All data computed within the project will be retained in a read-only state for long term reference.
Deprecated and disabled functionality¶
Because of outdated dependencies, Python 2 projects will transition first to deprecated and later to disabled. The following table describes the differences.
Stage | Impact | Function |
---|---|---|
Deprecated | No functional impact. A prominent notification will inform users that Python 2 projects will not be supported in the future and that action should be taken to migrate as necessary. | Models and deployments continue to function as expected. |
Disabled | Further actions on these projects is prevented. Any pre-computed data can be viewed for reference and comparison while migrating to Python 3 and will be retained long-term for audit purposes. | Project and model data is read-only. Any actions involving compute jobs are disabled (e.g., retraining models, adding new models, computing insights charts, etc.). REST API and associated clients will similarly prevent these actions. The following functionality will still be enabled: duplicating projects, and downloading Scoring Code, models, model packages, and insights. Predictions via the public API will no longer function. You must instead use the Prediction API or Batch Prediction API. |
The following functionality is not affected:
- Custom models
- No-code AI Apps
- AI Catalog
- Data Prep
Guide for migrating to Python 3¶
Use the following procedures to migrate projects and deployments. For scenarios not covered, contact your DataRobot representative.
Migrate projects¶
Migrate projects and models using the “Duplicate project” action on the Manage Projects page. This will create a new project using Python 3 from the same dataset and the same advanced options (for eligible project types).
Once copied, you must manually recreate models within the project. You can either:
- Re-run Autopilot to build all models.
- Use Manual mode to build select models from the Repository.
After the Python 2 project is migrated, you can delete the project.
Migrate deployments¶
For deployments based on a Python 2 model, you have several options:
Option | Notes |
---|---|
Replace the deployed model with a Python 3 model after creating a new project. | This is the most straightforward option. While it will require time to build new models and perform the model replacement, it will not impact deployment API predictions because model replacements are seamless. |
Set up an automatic retraining policy for your model to let the DataRobot rebuild and replace the model for you automatically, using the schedule and modeling strategies you specify. |
|
Replace the model with a Custom inference model using the Java Drop-in environment and the Scoring Code export for the Python 2 model. |
|
Export the model package and use the DataRobot Portable Prediction Server (PPS) to serve predictions within your own environment. |
|
Tips¶
The following tips will help with the migration process.
-
Use project tags to keep track of which projects need to be migrated (for example,
py2-to-migrate
) and which ones have already been migrated (for example,py2-migrated
). -
Compute any insights charts that you may want to refer to in the future prior to June 2022 so that they are precomputed and will later be available as read-only when the project becomes disabled.
FAQ¶
How can I identify which projects and models use Python 2 and are impacted?
For managed AI Platform users, any projects created before March 7, 2022 are based on Python 2 and will be deprecated.
By the end of April 2022, you will see a Deprecation alert on the Models tab for affected projects similar to the following:
On the Manage Projects screen, you will see an icon next to deprecated projects:
API users can identify impacted projects that use Python 2. If you take actions against a Python 2 project via the API, the response object will return a Deprecation
header, which is translated by the DataRobot Python API client into a raised ProjectDeprecationWarning
. Actions taken against Python 3 projects do not lead to this Deprecation response header or ProjectDeprecationWarning
.
Starting with the 8.0.3 release, the Python Version field is added to the User Activity Monitor reports for App Usage and Predictions Usage in the UI, API, and exported CSV data. The data can be filtered on python 2.7 to see usage.
For help producing a report, contact your DataRobot representative.
Why is Python 2 being deprecated and removed?
Python 2 was end of life (EOL) in Jan 2020, and the Python Software Foundation stopped providing patches for bugs and security vulnerabilities. It is no longer supported by the community. DataRobot is removing it from the platform entirely to avoid security risks.
The DataRobot platform uses many third-party libraries that have also dropped support for Python 2. Upgrading to newer versions of those libraries requires removing Python 2 support.
Why do projects and models using Python 2 need to be migrated?
To minimize user impact from this change, DataRobot has made as many areas of the platform as compatible as possible. In fact, changes have been rolling out incrementally over the past few years, likely unnoticed. However, to avoid potentially significant incompatibilities in model performance and prediction consistency, it became necessary to make a hard break from old models trained under Python 2.
As the most trusted AI platform, DataRobot wants to ensure that customers are in complete control over managing their AI models and are owners of the decision to replace a model.
What happens to project data for deprecated projects after they are disabled?
So that it can serve as a reference for auditing purposes, all Python 2 project data will be retained and will be accessible within the application in a read-only state. To ensure thorough audit material, it is highly recommended that you compute insights and generate compliance documentation on these projects prior to the "disabled" milestone.
Will DataRobot still support older Self-Managed AI Platform releases that use Python 2?
Yes. The deprecation of Python 2 does not affect the support policy for Self-Managed AI Platform users on supported enterprise releases. DataRobot will continue to honor the Long Term Support (LTS) commitments for those customers.
Beginning with Release 9.0 and going forward, Python 2 will no longer be supported.
I’m a relatively new customer that installed Release 7.1 or later in my Self-Managed AI Platform environment. Does this impact me?
Possibly. New Self-Managed AI Platform installations since 7.1 using Docker or RPM configurations have been configured to use Python 3 for all projects. In this case, no action is required.
However, Hadoop-based installations (Cloudera, Hortonworks) did not have Python 3 enabled for new projects. In these cases, you will need to migrate projects.
If you have any questions about your install type, contact the IT Admin who performed the install. Ask them to verify that the configuration (config.yaml
) setting for PYTHON3_SERVICES
is enabled. Or, reach out to your DataRobot representative for help verifying the configuration.