You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we have a bunch of configuration settings that users can tweak. However, to change them, users have to put them in all their notebooks.
A better alternative would be to let them define the config project-wide in a pyproject.toml file (which is becoming standard in the Python ecosystem).
Example, a sample pyproject.toml could look like this:
Note that we should recursively look for the pyproject.toml, you can copy this function.
This behavior should be triggered when loading the extension. e.g., running %load_ext sql should display a message if a pyproject.toml is found and it should print the loaded settings and its values.
Some edge cases:
if the option doesn't exist, we should display a message when loading the settings
if there's a typo, we should provide a did you mean {x}? hint in the message (e.g., fedback instead of feedback)
if assigning the value throws an error, we should show a message and tell the user, the default value will be used
e.g., the user has autopandas="not-a-valid-value"
The text was updated successfully, but these errors were encountered:
Running %load_ext sql triggers pyproject.toml file and displays a message that it found the file, prints out loaded settings, and changes configuration settings
If pyproject.toml does not exist, it displays a message
If there's a typo on one of the settings, it displays a message hinting at what a user might intend
If an invalid value for setting is provided, it displays a message that it is not a valid value and uses the default value instead.
Add documentation for explaining setting up pyproject.toml
Running %load_ext sql triggers pyproject.toml file and displays a message that it found the file, prints out loaded settings, and changes configuration settings
This should trigger loading the file and notify the user if it found it. it should also look up in parent directories (in case the notebook is in project/notebooks/mynotebook.ipynb but the config file is in project/pyproject.toml)
If pyproject.toml does not exist, it displays a message
No need to do anything if the file doesn't exist
If there's a typo on one of the settings, it displays a message hinting at what a user might intend
If an invalid value for setting is provided, it displays a message that it is not a valid value and uses the default value instead.
these two are highly related. you can use difflib if there's something in the config file (under the tool.jupysql.SqlMagic section) that doesn't exist, you check if there are close matches. if so, the error message should suggest the fixed version. if there are no close matches, you simply return the value in the config file and tell the user that those are invalid, and show a link to the docs
we have a bunch of configuration settings that users can tweak. However, to change them, users have to put them in all their notebooks.
A better alternative would be to let them define the config project-wide in a pyproject.toml file (which is becoming standard in the Python ecosystem).
Example, a sample pyproject.toml could look like this:
Note that we should recursively look for the
pyproject.toml
, you can copy this function.This behavior should be triggered when loading the extension. e.g., running
%load_ext sql
should display a message if apyproject.toml
is found and it should print the loaded settings and its values.Some edge cases:
did you mean {x}?
hint in the message (e.g.,fedback
instead offeedback
)e.g., the user has
autopandas="not-a-valid-value"
The text was updated successfully, but these errors were encountered: