Tilman Schmiedeberg
06/07/2023, 9:54 AMTilman Schmiedeberg
06/07/2023, 9:57 AMDavide Rossi
06/25/2023, 12:53 PMDavide Rossi
06/25/2023, 12:54 PMfoo = 'bar'
-- new cell --
%%sql --save {{foo}} --no-execute
SELECT 1
-- new cell --
result = %sql SELECT * from {{foo}}
Is there a way to have foo
expanded for the --save
parameter?gerald mutuku
11/04/2023, 11:24 AMRuntimeError: (pymysql.err.OperationalError) (1045, "Access denied for user 'root'@'localhost' (using password: YES)")
Ryan H
11/17/2023, 12:07 PM--persist
argument, is there a way to specify the schema where the df will be saved?
Keep running in to errors because my DB engine requires a schema be specified
Thank you!Gabriel Westmarwick
11/20/2023, 12:16 AMGabriel Westmarwick
11/20/2023, 12:20 AMJon Mellman
11/22/2023, 1:35 AMBrandon Williams
12/06/2023, 1:51 PM%sqlcmd connect
gives
[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'ConnectorModel' from module 'jupysql-plugin'
Error: No version of module jupysql-plugin is registered
at ph.loadClass (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4099813|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4099813>)
at ph.loadClass (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4403287|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4403287>)
at ph.loadModelClass (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4097773|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4097773>)
at ph._make_model (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4094616|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4094616>)
at ph.new_model (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4092246|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4092246>)
at ph.handle_comm_open (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4091039|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4091039>)
at <https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4402511|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.17/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4402511>
at r._handleCommOpen (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-2023.10.1100000000-darwin-arm64/out/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:9:114159|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-2023.10.1100000000-darwin-arm64/out/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:9:114159>)
at async r._handleMessage (<https://file>+.<http://vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-2023.10.1100000000-darwin-arm64/out/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:9:116034|vscode-resource.vscode-cdn.net/Users/bwilliams/.vscode/extensions/ms-toolsai.jupyter-2023.10.1100000000-darwin-arm64/out/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:9:116034>)
I've tried installing with both pip and conda, and have tried explicitly installing jupysql-plugin
. If I try to manually enable the extension, I get
(eqgrid) ➜ helios git:(bwilliams/tc-add-features) jupyter nbextension enable jupysql-plugin
Enabling notebook extension jupysql-plugin...
- Validating: problems found:
- require? X jupysql-plugin
I know the logs say vscode but this occurs in JupyterLab as well.
Any ideas?Jesse Sommerfeld
12/13/2023, 9:32 PMJohn Gunnarsson
01/10/2024, 9:45 PMimport pyodbc
pyodbc.drivers()
in a notebook i get
['ODBC Driver 18 for SQL Server']
as a result, so driver is correctly installed, however when trying to connect to a mssql database defined in my connection.ini using the %sqlcmd connect i get this error
UsageError: An error happened while creating the connection: (pyodbc.InterfaceError) ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found and no default driver specified (0) (SQLDriverConnect)')
(Background on this error at: <https://sqlalche.me/e/20/rvf5>).
In order to specify the driver, i modified the ini file to include the query parameter aswell, but I cant figure out the format to use for jupysql to understand its a dictionary. The complete connection.ini looks like this:
[mydb]
drivername = mssql+pyodbc
username = jupyter
password = pwd
host = host
port = 1433
database = Datawarehouse2
query = {'driver': 'ODBC Driver 18 for SQL Server','Encrypt': 'yes', 'TrustServerCertificate': 'yes'}
The error i get when connection is now
ValueError: not enough values to unpack (expected 2, got 1)
Could someone point me in the right direction, either how to solve the first issue without the need to specifying "query" parameter, or how it should be formatted correctly.
Many thanks in advance 🙂Surjan S Rawat
01/13/2024, 12:54 AMRaj Mehta
01/24/2024, 5:43 AMRaj Mehta
01/24/2024, 5:46 AMSilmara Gomes Barnabe
02/08/2024, 1:33 AMbegin transaction
and rollback
commands.
but this error is appearing
how can I solve?salvador orjuela
02/12/2024, 6:59 AMSurjan S Rawat
02/15/2024, 10:59 PM[trino]
Trino.auth=trino.auth.JWTAuthentication(${JWT_TOKEN_VAR})
Trino.host='<http://myhost.abc.com|myhost.abc.com>'
Trino.port=443
Trino.user= ${USER_ID_VAR}
Trino.httpScheme='https'
Trino.cacheTTL=600
Trino.outputFile='/tmp/mytrinodb.schema.json'
Trino.catalogs="mycata1"
Ahmed Salah
03/05/2024, 7:59 PMTechScholar Hub
03/06/2024, 7:01 PMUsageError: An error happened while creating the connection: type object 'ClickHouseDialect_http' has no attribute 'dbapi'.
Perhaps you meant to use the 'clickhouse' db
To find more information regarding connection: <https://jupysql.ploomber.io/en/latest/integrations/clickhouse.html>
To fix it:
Pass a valid connection string:
Example: %sql <postgresql://username:password@hostname/dbname>
For more details, see: <https://jupysql.ploomber.io/en/latest/connecting.html>
Nadira Shoketayeva
03/28/2024, 8:33 AM--with=transform_types,recrafts,image_types
--with transform_types --with recrafts --with image_types
--with transform_types,recrafts,image_types
Nadira Shoketayeva
04/10/2024, 7:34 PMRuntimeError: Orig exception: Code: 394. DB::Exception: Query was cancelled. (QUERY_WAS_CANCELLED) (version 23.8.11.28 (official build))
If you need help solving this issue, send us a message: <https://ploomber.io/community>
Martin Jones
05/01/2024, 10:13 AM%%sql
LOAD DATA LOCAL INFILE 'penguins.csv'
INTO TABLE PENGUIN (
SPECIES, ISLAND, BILL_LENGTH, BILL_DEPTH, FLIPPER_LENGTH,
BODY_MASS, SEX, YEAR
)
and getting
RuntimeError: (pymysql.err.OperationalError) (3948, 'Loading local data is disabled; this must be enabled on both the client and server sides')
as far as I can tell it's enabled on the server:
%%sql
show global variables like 'local_infile';
Running query in '<mysql+pymysql://martin>:***@localhost/mysql'
1 rows affected.
Variable_name Value
local_infile ON
Wim Van Leuven
05/15/2024, 8:35 AMValueError: not enough values to unpack (expected 2, got 1)
... which brings me here...Paul Wilson
05/16/2024, 10:24 PMTommy
06/11/2024, 12:08 AMimport duckdb
%load_ext sql
%sql duckdb:///test.db
# %%
%%sql
DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data AS SELECT * FROM read_csv_auto('/tmp/data.csv');
-- Below works when run within the notebook.
select count(*) from test_data;
However, when I open test.db afterwards, the table is not there. I tried wrapping the query inside BEGIN TRANSACTION
… COMMIT
but I get an error saying transactions are not supported. Is there anything specific I need to do to make sure the data saves?Jon Mellman
07/07/2024, 7:47 AM%%sql
cells in VSCode jupyter notebooks? I believe the syntax highlighting docs are for Jupyter Lab, and not VSCode. jupysql is working great, this is the one thing that’s kind of annoying 😕Andres Ladino
07/11/2024, 2:37 PMquery_template = """
SELECT
MONTH(created) AS month,
COUNT(*) AS row_count
FROM
{table_name}
GROUP BY
MONTH(created)
ORDER BY
month;
"""
m2m = []
for table in ("T1", "T2", "T3"):
query = query_template.format(table_name=table)
result = %sql {query}
m2m.append(result)
Tilman Schmiedeberg
07/25/2024, 12:05 PMTilman Schmiedeberg
07/25/2024, 12:05 PM