From 47ba20200dcba77a5a6cc760e29cd2afcd8ed8d7 Mon Sep 17 00:00:00 2001 From: neelasha23 Date: Thu, 25 Jan 2024 12:54:55 +0530 Subject: [PATCH] profile --- doc/user-guide/data-profiling.md | 20 ++++++++++++++++++++ doc/user-guide/tables-columns.md | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/doc/user-guide/data-profiling.md b/doc/user-guide/data-profiling.md index 83ebd4d4c..fe9cc0b29 100644 --- a/doc/user-guide/data-profiling.md +++ b/doc/user-guide/data-profiling.md @@ -119,3 +119,23 @@ Let's profile `my_numbers` of `b_schema` ```{code-cell} ipython3 %sqlcmd profile --table trips --schema some_schema ``` + +### Parametrizing arguments + +JupySQL supports variable expansion of arguments in the form of `{{variable}}`. Let's see and example using `table`, `schema` and `output`. + +```{code-cell} ipython3 +table = "trips" +schema = "some_schema" +output = "my-report.html" +``` + +```{code-cell} ipython3 +%sqlcmd profile --table {{table}} --schema {{schema}} --output {{output}} +``` + +```{code-cell} ipython3 +from IPython.display import HTML + +HTML("my-report.html") +``` diff --git a/doc/user-guide/tables-columns.md b/doc/user-guide/tables-columns.md index 42e60b060..1973ec335 100644 --- a/doc/user-guide/tables-columns.md +++ b/doc/user-guide/tables-columns.md @@ -68,6 +68,16 @@ Pass `--schema/-s` to get tables in a different schema: +++ +JupySQL also supports variable expansion of arguments in the form of `{{variable}}`. Let's see an example: + +```{code-cell} ipython3 +schema = "schema" +``` + +```{code-cell} ipython3 +%sqlcmd tables --schema {{schema}} +``` + ## List columns Use `%sqlcmd columns --table/-t` to get the columns for the given table. @@ -104,3 +114,14 @@ Get the columns for the table in the newly created schema: ```{code-cell} ipython3 %sqlcmd columns --table numbers --schema some_schema ``` + +JupySQL supports variable expansion of arguments in the form of `{{variable}}`. Let's see an example of parametrizing `table` and `schema`: + +```{code-cell} ipython3 +table = "numbers" +schema = "some_schema" +``` + +```{code-cell} ipython3 +%sqlcmd columns --table {{table}} --schema {{schema}} +``` \ No newline at end of file