From f7f2f0ace8c7fd2b1e245500dc1beb6af2d35476 Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Sun, 22 Oct 2023 01:29:11 -0500 Subject: [PATCH 1/4] Some bug fixes for doc strings - config file was changing color for the entire environment without reverting back - chart magic was using verticapy.chart - there was a warning that needed to be acknowledged --- verticapy/_config/config.py | 8 +++++--- verticapy/jupyter/extensions/chart_magic.py | 2 +- verticapy/sql/geo/index.py | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/verticapy/_config/config.py b/verticapy/_config/config.py index beada990b..78dffc6d5 100755 --- a/verticapy/_config/config.py +++ b/verticapy/_config/config.py @@ -386,12 +386,14 @@ def set_option(key: str, value: Any = None) -> None: .. important:: The API will exclusively use these colors for drawing graphics. - .. ipython:: python + .. code-block:: python set_option("colors", ["blue", "red"]) - @savefig _config_config_set_option_hist.png - titanic.hist(["pclass", "survived"]) + .. warning:: + + This can be unstable if not enough colors are provided. It is advised to + use the plotting library color options to switch colors. Utilities ========= diff --git a/verticapy/jupyter/extensions/chart_magic.py b/verticapy/jupyter/extensions/chart_magic.py index abb1ca35e..92d494ec6 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.chart + %load_ext verticapy.hchart 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/sql/geo/index.py b/verticapy/sql/geo/index.py index 593e960a8..8055bc58c 100755 --- a/verticapy/sql/geo/index.py +++ b/verticapy/sql/geo/index.py @@ -274,6 +274,7 @@ def rename_index(source: str, dest: str, overwrite: bool = False) -> bool: :file: SPHINX_DIRECTORY/figures/sql_geo_index_rename_index_1.html .. ipython:: python + :okwarning: # Renames a specific index rename_index("world_polygons", "world_polygons_new") From 21c997287b41cbc3c389f9913e7477d15896bcd9 Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Sun, 22 Oct 2023 02:21:35 -0500 Subject: [PATCH 2/4] fixed insert_into --- verticapy/sql/insert.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/verticapy/sql/insert.py b/verticapy/sql/insert.py index 10b47dace..b7c709cf4 100755 --- a/verticapy/sql/insert.py +++ b/verticapy/sql/insert.py @@ -84,16 +84,16 @@ def insert_into( insert_into( table_name = "iris", schema = "public", - data = [[3.3, 4.5, 5.6, 7.8, "Iris-setosa"], - [4.3, 4.7, 9.6, 1.8, "Iris-virginica"]], + data = [[1001, 3.3, 4.5, 5.6, 7.8, "Iris-setosa"], + [1002, 4.3, 4.7, 9.6, 1.8, "Iris-virginica"]], ) # copy set to False: multiple inserts insert_into( table_name = "iris", schema = "public", - data = [[3.3, 4.5, 5.6, 7.8, "Iris-setosa"], - [4.3, 4.7, 9.6, 1.8, "Iris-virginica"]], + data = [[1001, 3.3, 4.5, 5.6, 7.8, "Iris-setosa"], + [1002, 4.3, 4.7, 9.6, 1.8, "Iris-virginica"]], copy=False, ) @@ -102,8 +102,8 @@ def insert_into( insert_into( table_name = "iris", schema = "public", - data = [[3.3, 4.5, 5.6, 7.8, "Iris-setosa"], - [4.3, 4.7, 9.6, 1.8, "Iris-virginica"]], + data = [[1001, 3.3, 4.5, 5.6, 7.8, "Iris-setosa"], + [1002, 4.3, 4.7, 9.6, 1.8, "Iris-virginica"]], genSQL=True, ) From 4e13f90485d9cf909c199c54d19d3ed4f0c7ee75 Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Sun, 22 Oct 2023 02:23:18 -0500 Subject: [PATCH 3/4] fixed black --- verticapy/_config/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verticapy/_config/config.py b/verticapy/_config/config.py index 78dffc6d5..5f7d07aa1 100755 --- a/verticapy/_config/config.py +++ b/verticapy/_config/config.py @@ -390,9 +390,9 @@ def set_option(key: str, value: Any = None) -> None: set_option("colors", ["blue", "red"]) - .. warning:: + .. warning:: - This can be unstable if not enough colors are provided. It is advised to + This can be unstable if not enough colors are provided. It is advised to use the plotting library color options to switch colors. Utilities From 9bc769ffee7330ef263815f4438f0fbddb8b281e Mon Sep 17 00:00:00 2001 From: umar <46414488+mail4umar@users.noreply.github.com> Date: Sun, 22 Oct 2023 05:15:26 -0500 Subject: [PATCH 4/4] Update config.py --- verticapy/_config/config.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/verticapy/_config/config.py b/verticapy/_config/config.py index 5f7d07aa1..687fe73a1 100755 --- a/verticapy/_config/config.py +++ b/verticapy/_config/config.py @@ -386,15 +386,24 @@ def set_option(key: str, value: Any = None) -> None: .. important:: The API will exclusively use these colors for drawing graphics. - .. code-block:: python + .. ipython:: python set_option("colors", ["blue", "red"]) + @savefig _config_config_set_option_hist.png + titanic.hist(["pclass", "survived"]) + .. warning:: This can be unstable if not enough colors are provided. It is advised to use the plotting library color options to switch colors. + .. ipython:: python + :suppress: + + set_option("colors", None) + + Utilities =========