Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

make the method show() print the results #291

Closed
djouallah opened this issue Mar 19, 2023 · 3 comments · Fixed by #296
Closed

make the method show() print the results #291

djouallah opened this issue Mar 19, 2023 · 3 comments · Fixed by #296
Labels
enhancement New feature or request

Comments

@djouallah
Copy link

for a compatibility with spark and Duckdb , can you please make ctx.sql('select 42').show() print the results please.

btw, version 8 is a very solid improvement !!!

@djouallah djouallah added the enhancement New feature or request label Mar 19, 2023
@djouallah djouallah changed the title make the methode show() print the results make the method show() print the results Mar 19, 2023
@simicd
Copy link
Contributor

simicd commented Mar 20, 2023

Hi @djouallah, thanks for reporting the issue and the feedback! I tried to reproduce the problem. When debugging in e.g. VS Code and run ctx.sql("SELECT 42").show() the result is not printed in the debug console but by default in the terminal. This is due to VS Code's debug settings:

Debug console
image

Terminal
image

I assume you'd like to show terminal outputs in the debug console. If that's the case you'd need to set the VS Code config to internal console in .vscode/launch.json as follows:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Debug",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "internalConsole",
          }
    ]
}

Once that's set both .show() will be printed in the same console:
image

This is assuming that you're using VS Code, chances are that if you're using another editor you will have similar possibilty to configure the output. Hope that helps, please feel free to share additional context if this is not what you were looking for

@djouallah
Copy link
Author

tried this in colab
image

why duckdb and pyspark works out of the box, can you do the same as they are doing ?

@simicd
Copy link
Contributor

simicd commented Mar 21, 2023

Thanks for the hint & additional context @djouallah, I was able to reproduce this in Jupyter notebooks now. I will take a look at how duckdb & PySpark are implementing the method In the meantime you can just drop .show() to preview the dataframe until the root cause of the issue is found:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants