Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

customizing results output #230

Closed
edublancas opened this issue Mar 12, 2023 · 2 comments · Fixed by #274
Closed

customizing results output #230

edublancas opened this issue Mar 12, 2023 · 2 comments · Fixed by #274
Assignees
Labels
good first issue Good for newcomers

Comments

@edublancas
Copy link

edublancas commented Mar 12, 2023

from a user on Slack:

As a data analyst doing ad-hoc SQL analysis I often times find myself creating SQL results in a notebook which contain URL values for a given column -- a bit of a "df as a dashboard" .
Is there any easy way to enable these URLs in the result set to be clickable? Maybe via a SqlMagic config?
Currently I have a bit of a hack to do this by (1) returning the query results to a df, then (2) calling method to style it if it looks like a URI (see this notebook), but a simpler way seems desirable and a feature others may find useful as well.

https://gist.github.com/gregrahn/2a1196d6a6588a7c04c52b5970895937
https://github.com/softhints/Pandas-Tutorials/blob/master/styling/create-clickable-link-pandas-dataframe-jupyterlab.ipynb

I think we have two options: either we provide a style API like pandas do or we parse the results automatically.

I think it's fine to parse them automatically; at the beginning, I was concerned about performance but users only display small tables in the results. Alternatively, we might setup a threshold: if the table has more than X cells, do not apply the styling.

@edublancas edublancas added the good first issue Good for newcomers label Mar 12, 2023
@AnirudhVIyer
Copy link

Good issue

@edublancas
Copy link
Author

the feature should be implemented for our ResultSet object:

class ResultSet(list, ColumnGuesserMixin):

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants