From 0a6f1640ca4755b305934807e0fe7152cff339e3 Mon Sep 17 00:00:00 2001 From: Badr Ouali <32390048+oualib@users.noreply.github.com> Date: Tue, 14 Nov 2023 22:15:19 +0100 Subject: [PATCH] Multiple changes (#862) - warning for old deprecated imports (we could not cover all of them) - updating changelogs - making plotly the main plotting lib - now %load_ext verticapy.chart works --- docs/source/chart_gallery_corr.rst | 6 +- docs/source/whats_new_v1_0_0.rst | 92 ++++++++++++------- verticapy/_config/config.py | 2 +- verticapy/chart/__init__.py | 17 ++++ verticapy/geo/__init__.py | 10 ++ verticapy/hchart/__init__.py | 10 ++ verticapy/jupyter/extensions/chart_magic.py | 2 +- verticapy/learn/__init__.py | 9 ++ verticapy/learn/cluster/__init__.py | 10 ++ verticapy/learn/decomposition/__init__.py | 10 ++ verticapy/learn/delphi/__init__.py | 10 ++ verticapy/learn/ensemble/__init__.py | 10 ++ verticapy/learn/linear_model/__init__.py | 10 ++ verticapy/learn/memmodel/__init__.py | 10 +- verticapy/learn/metrics/__init__.py | 10 ++ verticapy/learn/model_selection/__init__.py | 10 ++ verticapy/learn/naive_bayes/__init__.py | 10 ++ verticapy/learn/neighbors/__init__.py | 10 ++ verticapy/learn/pipeline/__init__.py | 10 ++ verticapy/learn/preprocessing/__init__.py | 10 ++ verticapy/learn/svm/__init__.py | 10 ++ verticapy/learn/tools/__init__.py | 10 ++ verticapy/learn/tree/__init__.py | 10 ++ verticapy/learn/tsa/__init__.py | 12 +++ verticapy/learn/vmodel/__init__.py | 9 ++ .../vertica/feature_extraction/text.py | 1 + verticapy/stats/__init__.py | 13 +++ verticapy/udf/__init__.py | 10 ++ verticapy/utilities/__init__.py | 10 ++ verticapy/vdataframe/__init__.py | 10 ++ 30 files changed, 326 insertions(+), 37 deletions(-) create mode 100755 verticapy/chart/__init__.py diff --git a/docs/source/chart_gallery_corr.rst b/docs/source/chart_gallery_corr.rst index c6ca149eb..1ec044d06 100644 --- a/docs/source/chart_gallery_corr.rst +++ b/docs/source/chart_gallery_corr.rst @@ -97,7 +97,7 @@ Please click on the tabs to view the various graphics generated by the different .. code-block:: python - %load_ext verticapy.hchart + %load_ext verticapy.chart We write the SQL query using Jupyter magic cells. @@ -161,7 +161,7 @@ Please click on the tabs to view the various graphics generated by the different .. code-block:: python - %load_ext verticapy.hchart + %load_ext verticapy.chart We write the SQL query using Jupyter magic cells. @@ -231,7 +231,7 @@ Please click on the tabs to view the various graphics generated by the different .. code-block:: python - %load_ext verticapy.hchart + %load_ext verticapy.chart We write the SQL query using Jupyter magic cells. diff --git a/docs/source/whats_new_v1_0_0.rst b/docs/source/whats_new_v1_0_0.rst index ba6499684..e1298f784 100644 --- a/docs/source/whats_new_v1_0_0.rst +++ b/docs/source/whats_new_v1_0_0.rst @@ -4,27 +4,69 @@ Version 1.0.0 =============== - - This release contains some major changes, including: - - Micro Focus is now OpenText. All the documentation containing copyright information has been updated to represent the new ownership of Vertica and its associated products. - -- Requirements update: Python version 3.13 is now supported. -- Minimum supported Python version is 3.8. +- Requirements update: Python version 3.10-3.12 are now supported. +- Minimum supported Python version is 3.9. .. note:: An internal minimum function python decorator (@check_minimum_version) warns users if any of the Vertica modules do not meet the requirement for the function in use. +Versioning Guidelines +---------------------- + +We highly recommend transitioning to the syntax of version 1.0.0, as the previous versions were in beta and subject to potential changes at any moment. Our current versioning process follows a systematic approach: + + - **Major Version Increment:** This is reserved for substantial changes that involve a significant shift in syntax and may deprecate multiple elements. Users should be prepared for a notable adjustment in how they interact with the software. + - **Minor Version Increment:** Occurs when introducing new functionalities and making substantial improvements. Users can anticipate enhanced features and capabilities without major disruptions to their existing workflows. + - **Last Digit Increment:** Reserved for bug fixes and changes that do not influence the syntax or functionality of the previous version. These updates are aimed at enhancing stability and addressing issues without requiring users to adapt to a new syntax. + +By adhering to this versioning strategy, users can effectively navigate updates, ensuring a smooth transition while benefiting from the latest features, improvements, and bug fixes. + +Upcoming Changes: Deprecated Modules +------------------------------------- + +Several modules have been deprecated as part of a code restructuring initiative. Please be aware that the following import will soon be unsupported: + +.. code-block:: python + + # Moved to verticapy.sql.geo + import verticapy.geo + + # Moved to verticapy.machine_learning + # And also restructured + import verticapy.learn + + # Moved to verticapy.sql.functions + # And also restructured + import verticapy.stats + + # Moved to verticapy.sdk.vertica + import verticapy.udf + + # Moved to verticapy.sql + # And also restructured + import verticapy.utilities + + # Moved to verticapy.core + # And also restructured + import verticapy.vdataframe + + # New syntax: %load_ext verticapy.chart + %load_ext verticapy.hchart + +As this is a major version release and to uphold best practices, we are expeditiously phasing out all old methodologies. It is imperative to ensure a swift adaptation to the new syntax. Warnings have been issued for several imports, and they will soon be removed. + +In parallel, we are actively developing a set of new tests. Consequently, the current 'tests' folder will soon be replaced by 'tests_new'. Your cooperation in transitioning to the updated syntax and directory structure is greatly appreciated. Bug fixes ------------ +---------- -- Adjusted-R squared now works with "K" parameter +- Adjusted-R squared now works with "k" parameter - Corrected calculation of Prevalence Threshold - Fixed nested pie plots - Improved vDataFrame.balance() function @@ -41,15 +83,17 @@ Bug fixes ____ Machine Learning Support --------------------------- +------------------------- - New Vertica algorithms supported: + - IsolationForest - KPrototypes - Poisson Regression - AutoRegressive (AR) - MovingAverages (MA) - AutoRegressive Moving Averages (ARMA) - AutoRegressive Integrated Moving Averages (ARIMA) + - Term Frequency * Inverse Document Frequency (TFIDF). It is still beta. - New function for finding the feature importance for XGBoost models. - Classification metrics are now available for multiclass data/model using three methods: ``micro``, ``macro``, ``weighted``, ``score`` and ``none``. @@ -59,7 +103,7 @@ Machine Learning Support - Model Tracking and Versioning now supported. Check out :ref:`notebooks/ml/model_tracking_versioning/index.ipynb` for more details. - Model Export and Import: - Now models can be exported to ``pmml``, ``tensorflow``, and ``binary``. + Now models can be exported to ``pmml``, ``tensorflow``, and ``binary``. They can now be exported to another User Defined Location. _____ @@ -73,19 +117,16 @@ SQL import verticapy as vp vp.vDataFrame("(SELECT pclass, embarked, AVG(survived) FROM public.titanic GROUP BY 1, 2) x") - The new format supports other methods for creating ``vDataFrame``s. .. code-block:: python vp.vDataFrame({"X":[1,2,3],"Y":['a','b','c']}) - - _______ Plotting ------------ +--------- - Plotly is now the default plotting library, introducing improved visualizations. The Plotly plots are more interactive and enhance the user experience. - Plotly Outliers plot now has the option to customize colors using the ``colors`` parameter. @@ -112,21 +153,17 @@ Plotting - PLotly Histogram plot now allows multiple plots. - You can now easily switch between the plotting libraries using the following syntax: - .. code-block:: python from verticapy import set_option set_option("plotting_lib","matplotlib") - -.. note:: The ``Hchart`` function is deprecated. The Highcharts plots can be plotted using the regular SQL plotting syntax by setting Highcharts as the default plotting library. +.. note:: The ``hchart`` function is deprecated. The Highcharts plots can be plotted using the regular SQL plotting syntax by setting Highcharts as the default plotting library. - The parameters ``custom_height`` and ``custom_width`` have been added to all plots so that the sizes can be changed as needed. - - Validators now ensure that only supported options are selected for the VerticaPy options. - - Users can now plot directly from SQL queries: .. code-block:: python @@ -134,7 +171,6 @@ Plotting %load_ext verticapy.jupyter.extensions.chart_magic %chart -c sql_command -f input_file -k 'auto' -o output_file - The chart command is similar to the hchart command, accepting four arguments: 1. SQL command @@ -148,10 +184,8 @@ Plotting %chart -k pie -c "SELECT pclass, AVG(age) AS av_avg FROM titanic GROUP BY 1;" - - Classification Metrics -------------------------- +----------------------- Added support for many new classification and regression metrics. @@ -173,12 +207,11 @@ The following metrics have been added to the classification report: _____ -Library Heirarchy -------------------- +Library Hierarchy +------------------ Import structures have changed. The code has been completely restructured, which means that going forward all imports will be done differently. Currently, we still allow the previous structure of import, but it will gradually be deprecated. - The new structure has the following parent folders: - Core [includes ``vDataFrame``, parsers ``string_sql``, and ``tablesample``] @@ -192,14 +225,12 @@ The new structure has the following parent folders: .. note:: The folders with "_" subscript are internal - For example, to use Vertica's `LinearRegression`, it should now be imported as follows: .. code-block:: python from verticapy.machine_learning.vertica import LinearRegression - To import statistical tests: .. code-block:: python @@ -209,7 +240,7 @@ To import statistical tests: ____ Added Model Tracking tool (MLOps) ------------------------------------- +---------------------------------- It is a common practice for data scientists to train tens of temporary models before picking one of them as their candidate model for going into production. A model tracking tool can help each individual data scientist to easily track the models trained for an experiment (project) and compare their metrics for choosing the best one. @@ -262,7 +293,7 @@ Example: Others ---------- +------- - Docstrings have been enriched to add examples and other details that will help in creating a more helpful doc. - A new dataset "Africa Education" has been added to the dataset library. It can be easily imported using: @@ -282,7 +313,6 @@ Others - Verticapylab autoconnection. Slight modification to allow smooth integration of the upcoming VerticaPyLab. - Internal ========= diff --git a/verticapy/_config/config.py b/verticapy/_config/config.py index 37156fd73..d4883afa9 100755 --- a/verticapy/_config/config.py +++ b/verticapy/_config/config.py @@ -464,7 +464,7 @@ def set_option(key: str, value: Any = None) -> None: register_option( Option( "plotting_lib", - "matplotlib", + "plotly", "", in_validator(["highcharts", "matplotlib", "plotly"]), ) diff --git a/verticapy/chart/__init__.py b/verticapy/chart/__init__.py new file mode 100755 index 000000000..c10a86462 --- /dev/null +++ b/verticapy/chart/__init__.py @@ -0,0 +1,17 @@ +""" +Copyright (c) 2018-2023 Open Text or one of its +affiliates. Licensed under the Apache License, +Version 2.0 (the "License"); You may not use this +file except in compliance with the License. + +You may obtain a copy of the License at: +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in +writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing +permissions and limitations under the License. +""" +from verticapy.jupyter.extensions.chart_magic import load_ipython_extension diff --git a/verticapy/geo/__init__.py b/verticapy/geo/__init__.py index 70e43fe98..fed2e52bf 100755 --- a/verticapy/geo/__init__.py +++ b/verticapy/geo/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.geo' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.sql.geo' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.sql.geo.functions import ( coordinate_converter, intersect, diff --git a/verticapy/hchart/__init__.py b/verticapy/hchart/__init__.py index c10a86462..fb52f3270 100755 --- a/verticapy/hchart/__init__.py +++ b/verticapy/hchart/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Loading extension 'verticapy.hchart' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.chart' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.jupyter.extensions.chart_magic import load_ipython_extension diff --git a/verticapy/jupyter/extensions/chart_magic.py b/verticapy/jupyter/extensions/chart_magic.py index 92d494ec6..abb1ca35e 100644 --- a/verticapy/jupyter/extensions/chart_magic.py +++ b/verticapy/jupyter/extensions/chart_magic.py @@ -356,7 +356,7 @@ def chart_magic( .. ipython:: python :suppress: - %load_ext verticapy.hchart + %load_ext verticapy.chart Run the following to load some sample datasets. Once loaded, these datasets are stored in the 'public' schema. You can change the target schema with the diff --git a/verticapy/learn/__init__.py b/verticapy/learn/__init__.py index 62eb0aeaa..f1ccaaa64 100755 --- a/verticapy/learn/__init__.py +++ b/verticapy/learn/__init__.py @@ -14,3 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) diff --git a/verticapy/learn/cluster/__init__.py b/verticapy/learn/cluster/__init__.py index a07b02e3a..cfeb03d84 100755 --- a/verticapy/learn/cluster/__init__.py +++ b/verticapy/learn/cluster/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.cluster' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.cluster import ( BisectingKMeans, DBSCAN, diff --git a/verticapy/learn/decomposition/__init__.py b/verticapy/learn/decomposition/__init__.py index c90e83ab4..6650b0b24 100755 --- a/verticapy/learn/decomposition/__init__.py +++ b/verticapy/learn/decomposition/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.decomposition' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.decomposition import MCA, PCA, SVD diff --git a/verticapy/learn/delphi/__init__.py b/verticapy/learn/delphi/__init__.py index 5c50d9cc4..e21d52667 100755 --- a/verticapy/learn/delphi/__init__.py +++ b/verticapy/learn/delphi/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.delphi' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica.automl' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.automl.clustering import AutoClustering from verticapy.machine_learning.vertica.automl.dataprep import AutoDataPrep from verticapy.machine_learning.vertica.automl.supervised import AutoML diff --git a/verticapy/learn/ensemble/__init__.py b/verticapy/learn/ensemble/__init__.py index 2ec788781..883ef1d1c 100755 --- a/verticapy/learn/ensemble/__init__.py +++ b/verticapy/learn/ensemble/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.ensemble' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.ensemble import ( IsolationForest, RandomForestClassifier, diff --git a/verticapy/learn/linear_model/__init__.py b/verticapy/learn/linear_model/__init__.py index 4abce546c..ec07374f2 100755 --- a/verticapy/learn/linear_model/__init__.py +++ b/verticapy/learn/linear_model/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.linear_model' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.linear_model import ( ElasticNet, Lasso, diff --git a/verticapy/learn/memmodel/__init__.py b/verticapy/learn/memmodel/__init__.py index 1ebf00354..e4b0be598 100755 --- a/verticapy/learn/memmodel/__init__.py +++ b/verticapy/learn/memmodel/__init__.py @@ -14,4 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. """ -from verticapy.machine_learning.memmodel.base import InMemoryModel +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.memmodel' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.memmodel' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) diff --git a/verticapy/learn/metrics/__init__.py b/verticapy/learn/metrics/__init__.py index 47c005d7e..f1d371811 100755 --- a/verticapy/learn/metrics/__init__.py +++ b/verticapy/learn/metrics/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.cluster' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.metrics' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.metrics.classification import ( accuracy_score, best_cutoff, diff --git a/verticapy/learn/model_selection/__init__.py b/verticapy/learn/model_selection/__init__.py index 3f5945ba2..81fa776c2 100755 --- a/verticapy/learn/model_selection/__init__.py +++ b/verticapy/learn/model_selection/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.model_selection' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.model_selection' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.metrics.plotting import ( lift_chart, prc_curve, diff --git a/verticapy/learn/naive_bayes/__init__.py b/verticapy/learn/naive_bayes/__init__.py index 15350ae85..953c9a303 100755 --- a/verticapy/learn/naive_bayes/__init__.py +++ b/verticapy/learn/naive_bayes/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.naive_bayes' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.naive_bayes import ( BernoulliNB, CategoricalNB, diff --git a/verticapy/learn/neighbors/__init__.py b/verticapy/learn/neighbors/__init__.py index 19d6f0fae..403931440 100755 --- a/verticapy/learn/neighbors/__init__.py +++ b/verticapy/learn/neighbors/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.neighbors' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.neighbors import ( KNeighborsClassifier, KernelDensity, diff --git a/verticapy/learn/pipeline/__init__.py b/verticapy/learn/pipeline/__init__.py index 6a44c8dc1..a21f30b81 100755 --- a/verticapy/learn/pipeline/__init__.py +++ b/verticapy/learn/pipeline/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.pipeline' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.pipeline import Pipeline diff --git a/verticapy/learn/preprocessing/__init__.py b/verticapy/learn/preprocessing/__init__.py index 9400a23f3..1ae12bff5 100755 --- a/verticapy/learn/preprocessing/__init__.py +++ b/verticapy/learn/preprocessing/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.preprocessing' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.preprocessing import ( balance, CountVectorizer, diff --git a/verticapy/learn/svm/__init__.py b/verticapy/learn/svm/__init__.py index a302c70a8..6a735c7f8 100755 --- a/verticapy/learn/svm/__init__.py +++ b/verticapy/learn/svm/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.svm' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.svm import LinearSVC, LinearSVR diff --git a/verticapy/learn/tools/__init__.py b/verticapy/learn/tools/__init__.py index a2d1641c4..973c273f7 100755 --- a/verticapy/learn/tools/__init__.py +++ b/verticapy/learn/tools/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.tools' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.model_management import load_model diff --git a/verticapy/learn/tree/__init__.py b/verticapy/learn/tree/__init__.py index 538f0ce13..155824220 100755 --- a/verticapy/learn/tree/__init__.py +++ b/verticapy/learn/tree/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.tree' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.machine_learning.vertica.tree import ( DecisionTreeClassifier, DecisionTreeRegressor, diff --git a/verticapy/learn/tsa/__init__.py b/verticapy/learn/tsa/__init__.py index 62eb0aeaa..ffdf0a9c4 100755 --- a/verticapy/learn/tsa/__init__.py +++ b/verticapy/learn/tsa/__init__.py @@ -14,3 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.tsa' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions.\n" + "Note: SARIMAX and VAR have been removed. Please explore " + "and adopt one of the new in-database time series models " + "as a replacement." +) +warnings.warn(warning_message, Warning) diff --git a/verticapy/learn/vmodel/__init__.py b/verticapy/learn/vmodel/__init__.py index 62eb0aeaa..b18982d4d 100755 --- a/verticapy/learn/vmodel/__init__.py +++ b/verticapy/learn/vmodel/__init__.py @@ -14,3 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.learn.vmodel' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.machine_learning.vertica' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) diff --git a/verticapy/machine_learning/vertica/feature_extraction/text.py b/verticapy/machine_learning/vertica/feature_extraction/text.py index 02157328c..c9521892a 100644 --- a/verticapy/machine_learning/vertica/feature_extraction/text.py +++ b/verticapy/machine_learning/vertica/feature_extraction/text.py @@ -24,6 +24,7 @@ class Tfidf(VerticaModel): """ + [Beta Version] Create tfidf representation of documents. Parameters diff --git a/verticapy/stats/__init__.py b/verticapy/stats/__init__.py index d55b8cc77..cc0c90b48 100755 --- a/verticapy/stats/__init__.py +++ b/verticapy/stats/__init__.py @@ -14,6 +14,19 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.stats' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.sql.functions' instead " + "to ensure compatibility with upcoming versions.\n" + "Note: Statistical tests have been relocated to " + "'verticapy.machine_learning.model_selection.' " + "Please update your imports accordingly." +) +warnings.warn(warning_message, Warning) + from verticapy.sql.functions.analytic import ( avg, bool_and, diff --git a/verticapy/udf/__init__.py b/verticapy/udf/__init__.py index 1f2d7f427..2c5543d98 100755 --- a/verticapy/udf/__init__.py +++ b/verticapy/udf/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.udf' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.sdk.vertica.udf' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.sdk.vertica.udf import generate_lib_udf, import_lib_udf diff --git a/verticapy/utilities/__init__.py b/verticapy/utilities/__init__.py index e25279449..7fb28c85c 100755 --- a/verticapy/utilities/__init__.py +++ b/verticapy/utilities/__init__.py @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.utilities' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy' instead to ensure compatibility " + "with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy._config.config import set_option from verticapy._utils._sql._collect import save_to_query_profile from verticapy._utils._sql._vertica_version import vertica_version diff --git a/verticapy/vdataframe/__init__.py b/verticapy/vdataframe/__init__.py index d8ff921ed..a001a9736 100755 --- a/verticapy/vdataframe/__init__.py +++ b/verticapy/vdataframe/__init__.py @@ -14,4 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. """ +import warnings + +warning_message = ( + "Importing from 'verticapy.vdataframe' is deprecated, " + "and it will no longer be possible in the next release. " + "Please use 'verticapy.core' instead " + "to ensure compatibility with upcoming versions." +) +warnings.warn(warning_message, Warning) + from verticapy.core.vdataframe.base import vDataColumn, vDataFrame